:root {
  font-family: var(--fc-font-body);
  color: var(--fc-color-text);
  background: var(--fc-color-bg);
  font-size: 16px;
  --line: var(--fc-color-border);
  --blue: var(--fc-color-accent);
  /* Height of the sticky site header; sticky parts of pages sit just below it. */
  --header-h: 56px;
}
* {
  box-sizing: border-box;
}
body {
  margin: 0;
}
button,
input,
textarea,
select {
  font: inherit;
}
button {
  cursor: pointer;
  border: 1px solid var(--line);
  background: var(--fc-color-surface);
  color: var(--fc-color-text);
  border-radius: var(--fc-radius-lg);
  padding: 12px 19px;
  font-weight: 600;
  transition:
    background var(--fc-motion-duration-fast) var(--fc-motion-ease-standard),
    border-color var(--fc-motion-duration-fast) var(--fc-motion-ease-standard);
}
button:hover {
  border-color: var(--fc-color-border-strong);
  background: var(--fc-color-accent-soft);
}
button:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}
button[aria-busy='true'] {
  cursor: wait;
}
a {
  color: inherit;
  text-decoration: none;
}
button:focus-visible,
a:focus-visible,
input:focus-visible,
textarea:focus-visible {
  outline: 3px solid var(--fc-color-focus-ring);
  outline-offset: 3px;
}
.site-header {
  height: var(--header-h);
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 20px;
  --header-pad: 5vw;
  padding: 0 var(--header-pad);
  background: var(--fc-color-surface);
  border-bottom: 1px solid var(--line);
  position: sticky;
  top: 0;
  z-index: 30;
}
.logo {
  display: flex;
  align-items: center;
  gap: 9px;
  justify-self: start;
  font-size: 15px;
  font-weight: 750;
  letter-spacing: 0.3px;
}
.mark {
  display: grid;
  place-items: center;
  font-size: 18px;
  font-weight: 850;
  letter-spacing: -2px;
  background: var(--fc-color-nav-active);
  color: #fff;
  width: 30px;
  height: 30px;
  border-radius: var(--fc-radius-md);
  padding: 0 3px 2px 0;
}
/* Main tabs (設計選型 B2, 2026-11-26): wide screens put the names left, beside the logo, and underline the current page in the accent colour; phones move them to a tab bar at the bottom of the screen (below). */
.site-header nav {
  position: relative;
  align-self: stretch;
  display: flex;
  gap: 4px;
  margin-left: 12px;
  font-size: 14px;
}
.site-header nav a {
  display: flex;
  align-items: center;
  white-space: nowrap;
  padding: 0 14px;
  color: var(--fc-color-text-muted);
  font-weight: 500;
}
.site-header nav a:hover {
  color: var(--fc-color-text);
}
.site-header nav a.active {
  color: var(--fc-color-text);
  font-weight: 700;
  box-shadow: inset 0 -3px 0 var(--fc-color-accent);
}
.site-header .nav-icon {
  display: none;
  width: 22px;
  height: 22px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}
/* The underline is drawn once under the tabs and slides to the current one (header.js syncNav); the tab's own underline is only the fallback before it is placed. */
.site-header nav::before {
  content: '';
  position: absolute;
  left: 0;
  bottom: 0;
  width: var(--ink-w, 0);
  height: 3px;
  translate: var(--ink-x, 0) 0;
  background: var(--fc-color-accent);
  opacity: 0;
}
.site-header nav.has-ink::before {
  opacity: 1;
}
.site-header nav.ink-slide::before {
  transition:
    translate var(--fc-motion-duration-slow) var(--fc-motion-ease-standard),
    width var(--fc-motion-duration-slow) var(--fc-motion-ease-standard),
    opacity var(--fc-motion-duration-fast) ease;
}
.site-header nav.has-ink a.active {
  box-shadow: none;
}
.header-tools {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 6px;
}
.account,
.notify {
  position: relative;
}
.icon-button {
  width: 38px;
  height: 38px;
  padding: 0;
  border-radius: 50%;
  display: grid;
  place-items: center;
  color: var(--fc-color-text-muted);
}
.icon-button[aria-expanded='true'] {
  color: var(--fc-color-text);
  background: var(--fc-color-accent-soft);
}
.header-tools > * > .icon-button,
.header-search .icon-button {
  width: 36px;
  height: 36px;
  border: 0;
  background: transparent;
}
.header-tools > * > .icon-button:hover,
.header-search .icon-button:hover {
  color: var(--fc-color-text);
  background: var(--fc-color-accent-soft);
}
.header-search {
  position: relative;
}
/* Search: only its button shows; the button opens the box (.searching, header.js) beside it on wide screens and over the whole header on narrow ones. */
.search-field {
  display: flex;
  align-items: center;
  border: 1px solid transparent;
  border-radius: var(--fc-radius-pill);
}
.searching .search-field {
  border-color: var(--line);
  background: var(--fc-color-bg);
}
.searching .search-field:focus-within {
  border-color: var(--fc-color-border-strong);
  background: #fff;
}
.search-field {
  transition:
    border-color var(--motion-fast, 150ms) ease,
    background-color var(--motion-fast, 150ms) ease;
}
/* Closed, the box has no width and cannot be focused; opening it grows it out from the button. */
.header-search input {
  display: block;
  width: 0;
  min-width: 0;
  border: 0;
  background: transparent;
  padding: 0;
  font-size: 14px;
  outline: 0;
  visibility: hidden;
  transition:
    width var(--motion-base, 220ms) var(--motion-ease, ease),
    padding var(--motion-base, 220ms) var(--motion-ease, ease),
    visibility 0s var(--motion-base, 220ms);
}
.searching .header-search input {
  width: 220px;
  padding-left: 16px;
  visibility: visible;
  transition-delay: 0s;
}
/* Header buttons and tabs give a little when pressed; the bell rings once when its menu opens. */
.site-header :is(nav a, .icon-button, .avatar) {
  transition:
    scale 120ms ease,
    color var(--motion-fast, 150ms) ease,
    background-color var(--motion-fast, 150ms) ease;
}
.site-header :is(nav a, .icon-button, .avatar):active {
  scale: 0.94;
}
@keyframes fv-bell {
  20% {
    rotate: 14deg;
  }
  40% {
    rotate: -10deg;
  }
  60% {
    rotate: 6deg;
  }
  80% {
    rotate: -3deg;
  }
}
#notify-button[aria-expanded='true'] svg {
  transform-origin: 50% 15%;
  animation: fv-bell 480ms var(--motion-ease, ease);
}
@media (prefers-reduced-motion: reduce) {
  .header-search input {
    transition: none;
  }
  .site-header :is(nav a, .icon-button, .avatar):active {
    scale: none;
  }
  #notify-button[aria-expanded='true'] svg {
    animation: none;
  }
}
.search-cancel {
  display: none;
}
.search-pop {
  position: absolute;
  top: calc(100% + 8px);
  left: 0;
  right: 0;
  min-width: 260px;
  padding: 8px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--fc-radius-xl);
  box-shadow: 0 18px 50px #29315022;
}
.search-pop .menu-name {
  padding: 6px 10px;
}
.search-recent {
  display: flex;
  align-items: center;
  border-radius: var(--fc-radius-md);
}
.search-recent:hover,
.search-recent:focus-within {
  background: var(--fc-color-accent-soft);
}
.search-recent a {
  flex: 1;
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 10px;
  font-size: 14px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.search-recent svg {
  flex: none;
  color: var(--fc-color-text-muted);
}
.search-recent .icon-button {
  width: 32px;
  height: 32px;
  flex: none;
  font-size: 18px;
  font-weight: 400;
  color: var(--fc-color-text-muted);
}
.avatar {
  border-radius: 50%;
  background: var(--blue);
  color: white;
  width: 32px;
  height: 32px;
  margin-left: 4px;
  padding: 0;
  border: 0;
  font-size: 14px;
}
.avatar:hover {
  background: var(--blue);
  color: white;
}
/* Signed out: a quiet text link, not a second solid button. */
.avatar.guest,
.avatar.guest:hover {
  width: auto;
  border-radius: var(--fc-radius-sm);
  padding: 0 8px;
  background: none;
  color: var(--fc-color-text);
  font-size: 14px;
  font-weight: 500;
}
.avatar.guest:hover {
  text-decoration: underline;
  text-underline-offset: 3px;
}
.login-hint {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  margin-top: 24px;
  padding: 18px 20px;
  border: 1px solid var(--line);
  border-radius: var(--fc-radius-xl);
}
.login-hint p {
  margin: 0;
}
.pop {
  position: absolute;
  right: 0;
  top: 58px;
  background: white;
  box-shadow: 0 18px 50px #29315022;
  border: 1px solid var(--line);
  border-radius: var(--fc-radius-xl);
  width: 240px;
  padding: 12px;
}
.pop a {
  display: flex;
  justify-content: space-between;
  padding: 14px;
  border-radius: var(--fc-radius-md);
  font-size: 15px;
}
.pop a:hover {
  background: var(--fc-color-accent-soft);
}
.pop a span {
  color: var(--fc-color-text-muted);
  font-size: 12px;
}
#notify-menu {
  width: 300px;
}
.pop-empty {
  padding: 18px 14px 10px;
}
.pop-empty p {
  font-size: 13px;
  margin: 6px 0 0;
}
.menu-sep {
  margin: 6px 4px;
  border: 0;
  border-top: 1px solid var(--line);
}
.menu-name {
  padding: 10px 14px;
  color: var(--fc-color-text-muted);
  font-size: 12px;
  letter-spacing: 2px;
}
#app {
  max-width: 1360px;
  margin: auto;
  padding: 42px 40px 80px;
}
.eyebrow {
  font-size: 12px;
  letter-spacing: 0.5px;
  color: var(--fc-color-text-muted);
  font-weight: 650;
}
.page-top {
  display: flex;
  justify-content: space-between;
  align-items: end;
  gap: 20px;
  margin-bottom: 30px;
}
/* 見出しの右のボタンは縮めず 1 行のまま（説明文が長いと押し縮められて文字が折り返していた）。 */
.page-top > .button,
.page-top > button {
  flex: none;
  white-space: nowrap;
}
h1,
h2,
h3 {
  font-family: var(--fc-font-heading);
}
h1 {
  font-size: 36px;
  letter-spacing: -0.5px;
  font-weight: 900;
  margin: 9px 0 10px;
}
h2 {
  font-size: 21px;
  font-weight: 700;
  margin: 0;
}
h3 {
  font-size: 18px;
  line-height: 1.5;
  margin: 0;
}
p {
  line-height: 1.8;
  color: var(--fc-color-text-muted);
  margin: 8px 0;
}
.primary {
  background: var(--fc-color-accent);
  color: var(--fc-color-text-on-accent);
  border-color: var(--fc-color-accent);
}
.primary:hover {
  background: var(--fc-color-accent-hover);
  border-color: var(--fc-color-accent-hover);
  color: var(--fc-color-text-on-accent);
}
/* 1 画面に 1 つだけの主役ボタン（投票する・投稿するなど）。主ボタンと同じティールの単色（グラデーションなし）。 */
.feature {
  background: var(--fc-color-accent);
  color: var(--fc-color-text-on-accent);
  border-color: var(--fc-color-accent);
}
.feature:hover {
  background: var(--fc-color-accent-hover);
  border-color: var(--fc-color-accent-hover);
  color: var(--fc-color-text-on-accent);
}
.danger {
  background: var(--fc-color-danger);
  color: var(--fc-color-text-on-accent);
  border-color: var(--fc-color-danger);
}
.danger:hover {
  background: var(--fc-color-danger);
  filter: brightness(0.9);
  border-color: var(--fc-color-danger);
  color: var(--fc-color-text-on-accent);
}
.layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 292px;
  gap: 28px;
}
.card {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--fc-radius-xl);
  overflow: hidden;
}
.home-goods + .section-title {
  margin-top: 40px;
}

/* ホームの「グッズ」欄：投票中の作品図をランダムに数点。押すと投票ページ。名前や数は出さない。
   図の縦横比は作品ごとに違うので、枠いっぱいに切り抜いてどのカードも同じ高さに見せる */
.home-goods {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 12px;
}
.home-goods-card {
  display: block;
  aspect-ratio: 3 / 4;
  border-radius: var(--fc-radius-lg);
  overflow: hidden;
  background: radial-gradient(
    circle at 50% 35%,
    #fff,
    var(--fc-color-accent-soft)
  );
  transition:
    transform 0.2s,
    box-shadow 0.2s;
}
.home-goods-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 24px #1d25351f;
}
.home-goods-card:focus-visible {
  outline: 3px solid var(--blue);
  outline-offset: 2px;
}
.home-goods-card img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

#app > .section-title:first-child {
  margin-top: 0;
}

.shelf {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: 220px;
  gap: 18px;
  overflow-x: auto;
  padding-bottom: 6px;
}
.shelf-card {
  display: block;
  padding-bottom: 16px;
}
.shelf-card .cover {
  height: 170px;
}
.shelf-card p {
  font-size: 13px;
  margin: 4px 0 0;
}
.shelf-new {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 20px;
  border: 1.5px dashed var(--fc-color-border-strong);
  background: var(--fc-color-accent-soft);
  min-height: 240px;
}
.shelf-new:hover {
  background: var(--fc-color-accent-soft);
}
.shelf-phone,
.shelf-phone:hover {
  background: var(--fc-color-accent-soft);
  color: var(--fc-color-text-muted);
}
.shelf-plus {
  width: 52px;
  height: 52px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: var(--blue);
  color: #fff;
  font-size: 30px;
  line-height: 1;
  margin-bottom: 14px;
}
.picks {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 20px;
}
.picks-head {
  padding: 18px 24px 4px;
  font-size: 15px;
  color: var(--fc-color-text-muted);
}
.section-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin: 30px 0 18px;
}
.section-title a {
  font-size: 14px;
  color: var(--fc-color-text);
  text-decoration: underline;
  text-underline-offset: 3px;
}
.thread .section-title {
  margin: 22px 0 6px;
}
.thread .section-title h2 {
  font-size: 17px;
}
.grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 20px;
}
.work-card {
  padding-bottom: 18px;
}
.work-open {
  display: block;
}
.cover {
  height: 230px;
  display: block;
  width: 100%;
  object-fit: cover;
  background: var(--fc-color-surface-sunken);
}
.info {
  padding: 17px 20px 0;
}
.meta {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: var(--fc-color-text-muted);
  margin-top: 12px;
}
.mini-avatar {
  width: 25px;
  height: 25px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  flex: none;
}
/* Avatars are neutral: grey with the first letter in body text; the official account shows the logo mark (dark, like
 * .mark). The colour a user picked is no longer shown (unslop review G1, 2026-11-30). The signed-out header button
 * (.avatar.guest, 「ログイン」) is a text link (below .avatar). */
.avatar:not(.guest),
.avatar:not(.guest):hover,
.mini-avatar,
.person-avatar,
.share-avatar {
  background: var(--fc-color-surface-sunken);
  color: var(--fc-color-text);
  font-weight: 600;
}
.avatar:not(.guest):hover {
  background: var(--fc-color-border);
}
:is(.avatar, .mini-avatar, .person-avatar, .share-avatar).is-official,
.avatar.is-official:hover {
  background: var(--fc-color-nav-active);
  color: var(--fc-color-nav-active-text);
  font-weight: 850;
  letter-spacing: -0.08em;
}
.badge {
  font-size: 12px;
  color: var(--fc-color-text-muted);
  border: 1px solid var(--fc-color-border);
  border-radius: var(--fc-radius-sm);
  padding: 3px 8px;
  background: #fff;
  display: inline-block;
  margin-bottom: 12px;
}
.sidebar .card {
  padding: 25px;
  margin-bottom: 20px;
}
.sidebar p {
  font-size: 14px;
}
.num {
  font-size: 36px;
  letter-spacing: -1px;
  margin: 18px 0 3px;
}
.stat-row {
  display: flex;
  gap: 24px;
}
.stat-row > div {
  flex: 1;
}
.stat-row small {
  color: var(--fc-color-text-muted);
  font-size: 12px;
}
.workshop-link {
  display: block;
  margin-top: 24px;
  color: var(--fc-color-text);
  text-decoration: underline;
  text-underline-offset: 3px;
  font-weight: 650;
  font-size: 14px;
}
.topic-row {
  border-bottom: 1px solid var(--line);
  padding: 20px 24px;
  display: block;
}
.topic-row:last-child {
  border-bottom: 0;
}
.topic-row:hover {
  background: var(--fc-color-accent-soft);
}
.topic-row p {
  font-size: 14px;
  white-space: nowrap;
  text-overflow: ellipsis;
  overflow: hidden;
}
.reply-count {
  margin-left: auto;
  white-space: nowrap;
}
.empty {
  padding: 45px 28px;
  text-align: center;
}
.empty h3 {
  color: var(--fc-color-text-muted);
  margin-bottom: 9px;
}
.empty p {
  max-width: 460px;
  margin: 0 auto 22px;
  font-size: 14px;
}
.empty-icon {
  font-size: 26px;
  color: var(--fc-color-accent);
  margin-bottom: 18px;
}
.loading {
  padding: 60px;
  text-align: center;
  color: var(--fc-color-text-muted);
}
.tabs {
  display: flex;
  gap: 7px;
  margin-bottom: 24px;
}
.tabs button {
  font-size: 14px;
  background: transparent;
  border: 0;
  padding: 10px 17px;
}
.tabs .active {
  background: var(--fc-color-accent-soft);
  color: var(--fc-color-accent);
}
.vote-stage {
  display: grid;
  grid-template-columns: minmax(0, 1.65fr) minmax(280px, 1fr);
  min-height: 530px;
}
.vote-image {
  background: #192133;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 25px;
}
.vote-image img {
  width: 100%;
  height: 480px;
  object-fit: contain;
}
.vote-info {
  padding: 40px;
  display: flex;
  flex-direction: column;
}
.vote-info h2 {
  font-size: 26px;
  margin-top: 20px;
}
.actions {
  display: flex;
  gap: 12px;
}
.vote-info .actions {
  margin-top: auto;
  padding-top: 32px;
}
.vote-info .actions button {
  flex: 1;
  padding: 17px 10px;
}
.chosen {
  box-shadow: 0 0 0 3px var(--fc-color-border-strong);
}
.form-card {
  max-width: 740px;
  padding: 36px;
}
.field {
  display: block;
  margin: 24px 0;
}
.field span {
  display: block;
  font-size: 14px;
  color: var(--fc-color-text-muted);
  margin-bottom: 10px;
}
input,
textarea,
select {
  border: 1px solid var(--fc-color-border);
  background: var(--fc-color-accent-soft);
  border-radius: var(--fc-radius-md);
  padding: 13px;
  color: var(--fc-color-text);
  max-width: 100%;
}
.field input,
.field textarea {
  width: 100%;
}
textarea {
  resize: vertical;
  min-height: 120px;
}
.save-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 18px;
}
.save-actions button {
  font-size: 13px;
  padding: 8px 12px;
}
.thread {
  padding: 28px 32px 32px;
  max-width: 900px;
  margin: auto;
}
/* Post head: the kicker and board tag share one line above a compact title. */
.thread > .eyebrow {
  margin-right: 10px;
  letter-spacing: 2px;
}
.thread > .topic-tags {
  display: inline-flex;
  vertical-align: 1px;
  margin: 0;
}
.thread > .topic-tags .tag {
  margin-right: 6px;
}
.thread h1 {
  font-size: 28px;
  line-height: 1.4;
  letter-spacing: -0.5px;
  margin: 10px 0 6px;
}
.thread .body {
  white-space: pre-wrap;
  color: var(--fc-color-text-muted);
  line-height: 1.85;
  margin: 20px 0 0;
}
.comment {
  padding: 14px 0 10px;
  border-top: 1px solid var(--line);
}
.comment p {
  white-space: pre-wrap;
  color: var(--fc-color-text-muted);
}
.thread form textarea {
  width: 100%;
  min-height: 96px;
  margin: 16px 0 0;
  resize: vertical;
}
.back {
  display: inline-block;
  margin-bottom: 22px;
  color: var(--fc-color-text-muted);
  font-size: 14px;
}
/* On a post page the back link lines up with the post card instead of the page edge. */
.back:has(+ .thread) {
  margin: 0 0 14px max(0px, calc((100% - 900px) / 2));
}
.back:has(+ .thread)::before {
  content: '‹';
  margin-right: 6px;
  font-size: 16px;
}
.back:hover {
  text-decoration: underline;
}
#workshop-container {
  height: 100dvh;
}
/* 进入编辑器后不显示全站导航，返回作品列表用编辑器工具栏里的「作品一覧」。 */
body:has(#workshop-container:not([hidden])) > .site-header {
  display: none;
}
/* 从地址栏直接打开（或刷新）编辑器时，在 main.js 显示出第一个页面之前就是编辑器的深色底，不先闪出全站导航和白色的载入中页面（index.html 的 editor-boot）；编辑器淡入时底色也是深色。 */
.editor-boot,
:root:has(#workshop-container:not([hidden])) {
  background: #101114;
}
.editor-boot body > :is(.site-header, #app) {
  display: none;
}
#workshop-frame {
  width: 100%;
  height: 100%;
  border: 0;
  display: block;
}
#notice {
  position: fixed;
  bottom: 28px;
  left: 50%;
  transform: translateX(-50%);
  padding: 13px 24px;
  border-radius: var(--fc-radius-lg);
  background: #242d47;
  color: white;
  box-shadow: 0 8px 30px #20243722;
  z-index: 100;
  display: none;
  max-width: 90vw;
  font-size: 14px;
}
dialog {
  border: 1px solid var(--line);
  border-radius: var(--fc-radius-xl);
  width: min(600px, 92vw);
  padding: 32px;
  box-shadow: 0 25px 100px #22284430;
}
dialog::backdrop {
  background: #131d3f66;
  backdrop-filter: blur(5px);
}
dialog .actions {
  justify-content: end;
}
.error {
  color: #b64d5e;
  font-size: 14px;
}
[hidden] {
  display: none !important;
}
/* Narrow screens: only the search button shows; it opens the box over the whole header (.searching, header.js). */
@media (max-width: 1180px) {
  .site-header.searching .header-search {
    position: absolute;
    inset: 0;
    z-index: 2;
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 0 var(--header-pad);
    background: #fff;
    animation: fv-fade-in var(--motion-fast, 150ms) var(--motion-ease, ease);
  }
  .header-search input {
    transition: none;
  }
  .searching .search-field {
    flex: 1;
    min-width: 0;
    flex-direction: row-reverse;
    border: 1px solid var(--line);
    background: var(--fc-color-bg);
  }
  .searching .search-field:focus-within {
    border-color: var(--fc-color-border-strong);
    background: #fff;
  }
  .searching .header-search input {
    display: block;
    flex: 1;
    width: auto;
    min-width: 0;
    height: 44px;
    padding: 0 16px 0 0;
    /* 16px keeps iOS from zooming in on focus. */
    font-size: 16px;
  }
  .searching .header-search .icon-button {
    border: 0;
    background: none;
  }
  .searching .search-cancel {
    display: block;
    flex: none;
    border: 0;
    background: none;
    padding: 10px 4px;
    font-size: 14px;
    color: var(--fc-color-text-muted);
  }
  .searching .search-pop {
    top: 100%;
    left: 0;
    right: 0;
    border-radius: 0 0 16px 16px;
    border-top: 0;
    max-height: 60vh;
    overflow-y: auto;
  }
}
@media (max-width: 1000px) {
  .site-header {
    --header-pad: 25px;
  }
  .layout {
    grid-template-columns: minmax(0, 1fr) 240px;
  }
  .grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  #app {
    padding: 30px 25px;
  }
}
@media (max-width: 720px) {
  /* Phones (B2): one 52px row with the logo and tools; the tabs become a bar fixed to the bottom of the screen with an icon over each name. The bar sits inside the header, so it goes away wherever the header does (editor, share page); the full-screen vote covers it. */
  :root {
    --header-h: 52px;
    --tabbar-h: calc(64px + env(safe-area-inset-bottom));
  }
  /* No header there (or the full-screen vote covers it), so no room for the tab bar either. */
  :root:is(.bare-page, .editor-boot),
  :root:has(#workshop-container:not([hidden]), .vote-flow) {
    --tabbar-h: 0px;
  }
  /* Pages with their own bar fixed to the bottom (the contest post's .contest-dock, the entry page's Skip／Like) tuck the
     tab bar away, so the screen keeps one bar instead of two; scrolling up or reaching the end brings it back
     (header.js adds .tabbar-shown). --tabbar-visible is the height the tab bar covers right now: those bars sit on it,
     and take the home-indicator padding over when the tab bar is away (--dock-safe). */
  :root {
    --tabbar-visible: var(--tabbar-h);
    --dock-safe: 0px;
  }
  :root:has(.contest-dock, .entry-actions):not(.tabbar-shown) {
    --tabbar-visible: 0px;
    --dock-safe: env(safe-area-inset-bottom);
  }
  :root:has(.contest-dock, .entry-actions):not(.tabbar-shown) .site-header nav {
    transform: translateY(100%);
    visibility: hidden;
    transition:
      transform var(--fc-motion-duration-base) var(--fc-motion-ease-standard),
      visibility 0s var(--fc-motion-duration-base);
  }
  body {
    padding-bottom: var(--tabbar-h);
  }
  .site-header {
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 0 10px;
    --header-pad: 16px;
  }
  .site-header nav {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 40;
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 0;
    margin: 0;
    height: var(--tabbar-h);
    padding-bottom: env(safe-area-inset-bottom);
    background: var(--fc-color-surface);
    border-top: 1px solid var(--fc-color-border);
    font-size: 11px;
    transition: transform var(--fc-motion-duration-base)
      var(--fc-motion-ease-standard);
  }
  .site-header nav::before {
    content: none;
  }
  .site-header nav a {
    flex-direction: column;
    justify-content: center;
    gap: 3px;
    padding: 0;
  }
  .site-header nav a.active,
  .site-header nav.has-ink a.active {
    color: var(--fc-color-accent);
    box-shadow: none;
  }
  .site-header .nav-icon {
    display: block;
  }
  .searching .header-search input {
    height: 38px;
  }
  .header-tools {
    grid-column: 2;
    grid-row: 1;
    gap: 2px;
  }
  .site-header.searching .header-search {
    bottom: auto;
    height: 50px;
  }
  .mark {
    width: 28px;
    height: 28px;
    font-size: 17px;
  }
  .avatar,
  .icon-button {
    width: 34px;
    height: 34px;
  }

  .home-goods {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 8px;
  }

  .shelf {
    grid-auto-columns: 168px;
    gap: 12px;
  }
  .shelf-card .cover {
    height: 130px;
  }
  .picks {
    grid-template-columns: minmax(0, 1fr);
  }
  .layout {
    grid-template-columns: minmax(0, 1fr);
  }
  #app {
    padding: 26px 18px 60px;
  }
  h1 {
    font-size: 29px;
  }
  /* 狭い画面では、ボタンを説明文の下に回す。 */
  .page-top {
    align-items: center;
    flex-wrap: wrap;
    gap: 14px;
  }
  .grid {
    gap: 12px;
  }
  .cover {
    height: 180px;
  }
  .info {
    padding: 14px;
  }
  .vote-stage {
    grid-template-columns: minmax(0, 1fr);
  }
  .vote-image img {
    height: 300px;
  }
  .vote-info {
    padding: 25px;
  }
  .vote-info .actions {
    margin-top: 16px;
  }
  .form-card,
  .thread {
    padding: 24px;
  }
  .thread h1 {
    font-size: 24px;
  }
  .topic-row {
    padding: 18px;
  }
  .page-top p {
    font-size: 14px;
  }
  .page-top .primary {
    padding: 10px 14px;
    font-size: 14px;
  }
}

.layout > *,
.grid > *,
.picks > * {
  min-width: 0;
}
.info h3,
.thread,
.topic-row h3 {
  overflow-wrap: anywhere;
}
@media (max-width: 480px) {
  .meta {
    flex-wrap: wrap;
  }
}

.vote-image.vote-3d {
  padding: 0;
  min-width: 0;
  display: block;
  height: 690px;
}
.vote-3d iframe {
  width: 100%;
  height: 100%;
  display: block;
  border: 0;
}
.vote-stage {
  grid-template-columns: minmax(0, 2fr) minmax(270px, 1fr);
}
@media (max-width: 900px) {
  .vote-stage {
    grid-template-columns: minmax(0, 1fr);
  }
  .vote-image.vote-3d {
    height: 690px;
  }
  .vote-info {
    padding: 26px;
  }
  .vote-info .actions {
    padding-top: 18px;
  }
}
@media (max-width: 480px) {
  .vote-image.vote-3d {
    height: 650px;
  }
}

#app:has(.vote-stage) {
  padding-top: 24px;
}
#app:has(.vote-stage) .page-top {
  margin-bottom: 20px;
}
#app:has(.vote-stage) h1 {
  font-size: 29px;
}
#app:has(.vote-stage) .tabs {
  margin-bottom: 16px;
}
.vote-image.vote-3d {
  height: 620px;
}
@media (max-width: 480px) {
  .vote-image.vote-3d {
    height: 650px;
  }
}
.vote-info .badge {
  align-self: flex-start;
}
@media (min-width: 901px) {
  .vote-stage {
    min-height: 0;
  }
  .vote-image.vote-3d {
    height: clamp(420px, calc(100dvh - 350px), 620px);
  }
}
@media (max-width: 900px) {
  .vote-image.vote-3d {
    height: min(55dvh, 480px);
  }
  #app:has(.vote-stage) {
    padding-bottom: 110px;
  }
  .vote-info .actions {
    position: fixed;
    left: 0;
    right: 0;
    bottom: var(--tabbar-h, 0px);
    z-index: 30;
    margin: 0;
    padding: 12px 16px calc(12px + env(safe-area-inset-bottom));
    background: #fffffff2;
    border-top: 1px solid var(--line);
    box-shadow: 0 -8px 24px #2024371a;
  }
  .vote-info .actions button {
    padding: 14px 10px;
  }
  /* Above the phone tab bar, which already keeps clear of the home indicator. */
  @media (max-width: 720px) {
    .vote-info .actions {
      padding-bottom: 12px;
    }
  }
  body:has(.vote-stage) #notice {
    bottom: calc(96px + var(--tabbar-h, env(safe-area-inset-bottom)));
  }
}
.load-more {
  display: block;
  margin: 18px auto;
}

/* 帖子详情：操作栏、楼层（引用、メンション、編集、削除）。管理操作在 /admin/posts */
/* Below the post body: two quiet icon + label buttons, separated from the replies by a rule. */
.post-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px;
  margin: 12px 0 0;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--line);
}
.thread .post-actions button {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  min-height: 0;
  padding: 6px 8px;
  border: 0;
  border-radius: var(--fc-radius-md);
  background: none;
  color: var(--fc-color-text-muted);
  font-size: 13px;
  font-weight: 600;
}
.thread .post-actions button:first-child {
  margin-left: -8px;
}
.thread .post-actions button:hover,
.thread .post-actions button:focus-visible {
  background: var(--fc-color-accent-soft);
  color: var(--fc-color-accent);
}
.post-actions .icon {
  flex: none;
  width: 16px;
  height: 16px;
}
.thread .post-actions [aria-pressed='true'] {
  color: var(--fc-color-accent);
}
.post-actions [aria-pressed='true'] .icon path {
  fill: currentColor;
}
.comment {
  scroll-margin-top: 90px;
  transition: background-color 0.4s;
}
.comment > .meta {
  margin-top: 0;
}
/* The rule under the post's action bar already separates the first floor. */
.floors > .comment:first-child {
  border-top: 0;
}
/* Everything under a floor's name lines up with the name, not the avatar. */
.comment > .floor-body,
.comment > .quote,
.comment > .safety-fold,
.comment > .safety-gone,
.comment > .safety-flag,
.comment > .removed-note,
.floor-actions,
.floor-edit {
  margin-left: 33px;
}
.comment .floor-body {
  margin-top: 6px;
  margin-bottom: 0;
  line-height: 1.75;
}
.comment.target {
  background: var(--fc-color-accent-soft);
  margin: 0 -16px;
  padding-left: 16px;
  padding-right: 16px;
}
.comment .author {
  color: var(--fc-color-text);
  font-weight: 600;
  text-decoration: none;
}
.comment .author:hover,
.comment a.mention:hover {
  text-decoration: underline;
}
.floor-no {
  margin-left: auto;
}
.floor-no a {
  color: var(--fc-color-text-muted);
  text-decoration: none;
  font-variant-numeric: tabular-nums;
}
.comment .edited {
  font-size: 12px;
  color: var(--fc-color-text-muted);
}
.tag.hidden-tag {
  color: #9a3412;
  background: #ffedd5;
}
.hidden-floor .floor-body,
.hidden-floor .quote {
  opacity: 0.6;
}
.comment.removed .removed-note {
  color: var(--fc-color-text-muted);
  font-size: 14px;
  font-style: italic;
}
.comment a.mention {
  color: var(--fc-color-text);
  text-decoration: underline;
  text-decoration: none;
}
.quote {
  margin: 8px 0 0;
  padding: 8px 12px;
  border-left: 3px solid var(--fc-color-border-strong);
  background: var(--fc-color-bg);
  border-radius: 0 8px 8px 0;
  font-size: 14px;
}
.quote a {
  color: var(--fc-color-text-muted);
  font-weight: 600;
  text-decoration: none;
}
.quote p {
  margin: 4px 0 0;
  color: var(--fc-color-text-muted);
  white-space: pre-wrap;
}
/* Floor actions: a row of icon buttons; each shows its name above it on hover or keyboard focus. */
.floor-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 2px;
  margin-top: 4px;
  transform: translateX(-6px);
}
.floor-actions button {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  min-height: 0;
  padding: 0;
  border: 0;
  border-radius: var(--fc-radius-md);
  background: none;
  color: var(--fc-color-text-muted);
}
.floor-actions button:hover,
.floor-actions button:focus-visible {
  background: var(--fc-color-accent-soft);
  color: var(--blue);
}
.floor-actions [data-floor-act='delete']:hover,
.floor-actions [data-floor-act='delete']:focus-visible {
  background: #fdeef1;
  color: #c23a4f;
}
.floor-actions button::after {
  content: attr(aria-label);
  position: absolute;
  bottom: calc(100% + 6px);
  left: 50%;
  z-index: 2;
  transform: translateX(-50%);
  padding: 4px 8px;
  border-radius: var(--fc-radius-sm);
  background: #202437;
  color: #fff;
  font-size: 12px;
  font-weight: 600;
  line-height: 1.4;
  white-space: nowrap;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.12s;
}
.floor-actions button:first-child::after {
  left: 0;
  transform: none;
}
.floor-actions button:hover::after,
.floor-actions button:focus-visible::after {
  opacity: 1;
}
@media (hover: none) {
  .floor-actions button::after {
    display: none;
  }
}
.floor-edit textarea {
  width: 100%;
  margin: 12px 0 8px;
}
.floor-edit .actions {
  display: flex;
  gap: 8px;
  justify-content: flex-end;
}
.thread .quoting {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-top: 16px;
  padding: 6px 6px 6px 12px;
  border-left: 3px solid var(--blue);
  background: var(--fc-color-accent-soft);
  border-radius: 0 8px 8px 0;
  font-size: 14px;
}
.thread .quoting[hidden] {
  display: none;
}
.thread .quoting button {
  border: 0;
  background: none;
  padding: 2px 8px;
}
.thread .quoting + textarea {
  margin-top: 8px;
}
/* Reply box: text area, then the mention hint and the send button on one row. */
#comment-form {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0 12px;
}
#comment-form > .quoting,
#comment-form > textarea,
#comment-form > .error {
  flex: 1 0 100%;
}
#comment-form > .error {
  order: 1;
  margin: 8px 0 0;
}
#comment-form > .error:empty {
  display: none;
}
#comment-form > .hint {
  order: 2;
  flex: 1;
}
#comment-form > .primary {
  order: 3;
  margin-top: 10px;
  padding: 10px 22px;
}
.thread form .hint {
  margin: 10px 0 0;
  font-size: 12px;
  color: var(--fc-color-text-muted);
}
/* Search page (pages/search.js). The words are in the header's box, so the page starts with its title and results. */
.search-title {
  font-size: 22px;
  letter-spacing: 0;
  margin: 0 0 14px;
  overflow-wrap: anywhere;
}
.search-title .tag {
  font-size: 15px;
  vertical-align: 3px;
  margin: 0 2px;
}
.search-hint {
  font-size: 14px;
  color: var(--fc-color-text-muted);
  margin: 0;
}
.search-filter {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 4px 6px;
  font-size: 14px;
  color: var(--fc-color-text-muted);
  margin: -6px 0 14px;
}
.search-filter .tag {
  margin: 0;
}
.search-filter a {
  color: var(--fc-color-text);
  text-decoration: underline;
  text-underline-offset: 3px;
  font-weight: 650;
  margin-left: 6px;
}
/* One line of tabs that scrolls sideways when it does not fit. */
.search-tabs {
  display: flex;
  gap: 4px;
  margin: 0 0 16px;
  overflow-x: auto;
  scrollbar-width: none;
}
.search-tabs::-webkit-scrollbar {
  display: none;
}
.search-tabs a {
  flex: none;
  font-size: 14px;
  font-weight: 600;
  padding: 7px 14px;
  border-radius: var(--fc-radius-pill);
  color: var(--fc-color-text-muted);
  white-space: nowrap;
}
.search-tabs a:hover {
  background: var(--fc-color-accent-soft);
}
.search-tabs a.active {
  background: var(--fc-color-accent-soft);
  color: var(--fc-color-accent);
}
.search-tabs small,
.search-group h2 small {
  margin-left: 6px;
  color: var(--fc-color-text-muted);
  font-weight: 500;
  font-size: 12px;
}
.search-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 340px;
  gap: 16px;
  align-items: start;
}
.search-group {
  margin-bottom: 16px;
  border-radius: var(--fc-radius-xl);
}
.search-group-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 20px;
  border-bottom: 1px solid var(--line);
}
.search-group h2 {
  font-size: 15px;
  margin: 0;
}
.search-group-head a {
  font-size: 13px;
  font-weight: 650;
  color: var(--fc-color-text);
  text-decoration: underline;
  text-underline-offset: 3px;
  white-space: nowrap;
}
.search-group-head a::after {
  content: ' ›';
}
.search-row {
  display: block;
  padding: 12px 20px;
  border-bottom: 1px solid var(--line);
  overflow-wrap: anywhere;
}
.search-row:last-child {
  border-bottom: 0;
}
a.search-row:hover,
.search-row:has(h3 a:hover) {
  background: var(--fc-color-accent-soft);
}
.search-row h3 {
  font-size: 15px;
  line-height: 1.45;
  margin: 0 0 2px;
}
.search-row p {
  font-size: 13px;
  line-height: 1.6;
  color: var(--fc-color-text-muted);
  margin: 0;
}
.search-row mark {
  background: #fff1b8;
  color: inherit;
  border-radius: 3px;
}
.search-post p {
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  overflow: hidden;
}
.search-post .meta {
  margin-top: 6px;
  gap: 6px;
  font-size: 12px;
}
.search-post .mini-avatar {
  width: 20px;
  height: 20px;
  font-size: 11px;
}
.search-row .meta .tag {
  margin: 0;
}
.search-row .chip {
  margin: 6px 6px 0 0;
  padding: 2px 10px;
  font-size: 13px;
}
.search-row .chip small {
  margin-left: 6px;
  color: var(--fc-color-text-muted);
  font-size: 11px;
}
.search-row .chip:hover {
  border-color: var(--fc-color-border-strong);
}
.search-chips {
  padding-top: 8px;
  padding-bottom: 14px;
}
.search-contest,
.search-user {
  display: flex;
  gap: 14px;
  align-items: center;
}
.search-contest > div,
.search-user > div {
  min-width: 0;
}
.search-contest img {
  width: 104px;
  aspect-ratio: 16 / 9;
  object-fit: cover;
  border-radius: var(--fc-radius-md);
  flex: none;
}
.search-contest .badge {
  margin: 0 8px 0 0;
  padding: 1px 6px;
  font-size: 11px;
  vertical-align: 2px;
}
.search-contest p,
.search-user p {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.search-user .mini-avatar {
  width: 32px;
  height: 32px;
  font-size: 14px;
}
.search-user h3 .tag {
  margin: 0 0 0 8px;
}
.search-note {
  padding: 12px 20px;
  font-size: 13px;
  color: var(--fc-color-text-muted);
  border-top: 1px solid var(--line);
  margin: 0;
}
@media (max-width: 1000px) {
  .search-layout {
    display: block;
  }
}
@media (max-width: 720px) {
  .search-title {
    font-size: 19px;
    margin-bottom: 10px;
  }
  .search-tabs {
    margin: 0 -18px 12px;
    padding: 0 18px;
  }
  .search-group {
    margin-bottom: 12px;
    border-radius: var(--fc-radius-xl);
  }
  .search-row,
  .search-group-head {
    padding: 11px 14px;
  }
  .search-chips {
    padding-top: 6px;
    padding-bottom: 12px;
  }
  .search-contest {
    gap: 12px;
  }
  .search-contest img {
    width: 76px;
  }
  .search-note {
    padding: 11px 14px;
  }
}

/* 公式管理：投稿の管理（/admin/posts） */
.admin-posts,
.admin-floors {
  padding: 6px 24px;
}
.admin-post-list,
.admin-floor-list {
  list-style: none;
  margin: 0;
  padding: 0;
}
.admin-post,
.admin-floor {
  padding: 18px 0;
  border-bottom: 1px solid var(--line);
}
.admin-post:last-child,
.admin-floor:last-child {
  border-bottom: 0;
}
.admin-post {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 16px 24px;
}
.admin-post h3 {
  margin: 6px 0 2px;
  font-size: 16px;
}
.admin-post h3 a:hover {
  text-decoration: underline;
}
.admin-post-actions,
.admin-floor .actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
}
.admin-post-actions button,
.admin-post-actions a.button,
.admin-floor .actions button {
  font-size: 13px;
  padding: 7px 12px;
}
.admin-post-actions .pin-control {
  margin: 0 4px 0 0;
  font-size: 13px;
}
.admin-floor .meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: var(--fc-color-text-muted);
}
.admin-floor .floor-no {
  margin-left: 0;
  font-weight: 700;
  color: var(--fc-color-text-muted);
}
.admin-floor .floor-body {
  margin: 8px 0 10px;
  white-space: pre-wrap;
}
.admin-floor .actions {
  justify-content: flex-start;
}
.admin-floor .tag.warn {
  color: #8a5300;
  background: #fff1d9;
}
.admin-floor.removed .removed-note {
  margin: 8px 0 0;
  color: var(--fc-color-text-muted);
  font-size: 14px;
  font-style: italic;
}
@media (max-width: 760px) {
  .admin-posts,
  .admin-floors {
    padding: 4px 16px;
  }
  .admin-post {
    grid-template-columns: minmax(0, 1fr);
  }
  .admin-post-actions {
    justify-content: flex-start;
  }
}
