:root {
  font-family:
    'Noto Sans JP',
    -apple-system,
    BlinkMacSystemFont,
    'Hiragino Sans',
    'Hiragino Kaku Gothic ProN',
    'Yu Gothic',
    Meiryo,
    system-ui,
    sans-serif;
  color: #202437;
  background: #f4f5f9;
  font-size: 16px;
  --line: #e7e9f1;
  --blue: #5261ee;
  /* 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: white;
  color: #202437;
  border-radius: 12px;
  padding: 12px 19px;
  font-weight: 600;
}
button:hover {
  border-color: #bac1ed;
  background: #f5f6ff;
}
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 #a5afff;
  outline-offset: 3px;
}
.site-header {
  height: var(--header-h);
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
  align-items: center;
  gap: 20px;
  --header-pad: 5vw;
  padding: 0 var(--header-pad);
  background: #fff;
  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: #252b43;
  color: #fff;
  width: 30px;
  height: 30px;
  border-radius: 9px;
  padding: 0 3px 2px 0;
}
/* Main tabs: one capsule, the current page filled. */
.site-header nav {
  display: flex;
  gap: 2px;
  padding: 4px;
  border-radius: 999px;
  background: #eef0f6;
  font-size: 14px;
}
.site-header nav a {
  white-space: nowrap;
  padding: 7px 18px;
  border-radius: 999px;
  color: #5b6479;
  text-align: center;
}
.site-header nav a:hover {
  color: #303957;
  background: #e2e5f0;
}
.site-header nav a.active {
  color: #fff;
  background: #252b43;
  font-weight: 700;
}
/* The filled capsule is drawn once behind the tabs and slides to the current one (header.js syncNav, timing as the tab rows in motion.css); the tab's own fill is only the fallback before it is placed. */
.site-header nav {
  position: relative;
  isolation: isolate;
}
.site-header nav::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0;
  z-index: -1;
  width: var(--ink-w, 0);
  height: var(--ink-h, 0);
  translate: var(--ink-x, 0) var(--ink-y, 0);
  border-radius: 999px;
  background: #252b43;
  opacity: 0;
}
.site-header nav.has-ink::before {
  opacity: 1;
}
.site-header nav.ink-slide::before {
  transition:
    translate 280ms cubic-bezier(0.2, 0.8, 0.2, 1),
    width 280ms cubic-bezier(0.2, 0.8, 0.2, 1),
    opacity var(--motion-fast, 150ms) ease;
}
.site-header nav.has-ink a.active {
  background: transparent;
}
@media (prefers-reduced-motion: reduce) {
  .site-header nav.ink-slide::before {
    transition: 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: #646e85;
}
.icon-button[aria-expanded='true'] {
  color: #303957;
  background: #f1f3ff;
}
.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: #303957;
  background: #f1f3fb;
}
.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: 999px;
}
.searching .search-field {
  border-color: var(--line);
  background: #f7f8fb;
}
.searching .search-field:focus-within {
  border-color: #bac1ed;
  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: 16px;
  box-shadow: 0 18px 50px #29315022;
}
.search-pop .menu-name {
  padding: 6px 10px;
}
.search-recent {
  display: flex;
  align-items: center;
  border-radius: 9px;
}
.search-recent:hover,
.search-recent:focus-within {
  background: #f1f3ff;
}
.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: #8a93a8;
}
.search-recent .icon-button {
  width: 32px;
  height: 32px;
  flex: none;
  font-size: 18px;
  font-weight: 400;
  color: #8a93a8;
}
.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;
}
.avatar.guest {
  width: auto;
  border-radius: 999px;
  padding: 0 16px;
  font-size: 14px;
  font-weight: 700;
}
.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: 18px;
}
.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: 18px;
  width: 240px;
  padding: 12px;
}
.pop a {
  display: flex;
  justify-content: space-between;
  padding: 14px;
  border-radius: 9px;
  font-size: 15px;
}
.pop a:hover {
  background: #f1f3ff;
}
.pop a span {
  color: #646e85;
  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: #646e85;
  font-size: 12px;
  letter-spacing: 2px;
}
#app {
  max-width: 1360px;
  margin: auto;
  padding: 42px 40px 80px;
}
.eyebrow {
  font-size: 12px;
  letter-spacing: 2.4px;
  color: #646e85;
  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 {
  font-size: 36px;
  letter-spacing: -1px;
  font-weight: 700;
  margin: 9px 0 10px;
}
h2 {
  font-size: 21px;
  margin: 0;
}
h3 {
  font-size: 18px;
  line-height: 1.5;
  margin: 0;
}
p {
  line-height: 1.8;
  color: #5c6680;
  margin: 8px 0;
}
.primary {
  background: var(--blue);
  color: white;
  border-color: var(--blue);
}
.primary:hover {
  background: #4454db;
  color: white;
}
.danger {
  background: #c23a4f;
  color: white;
  border-color: #c23a4f;
}
.danger:hover {
  background: #a92f43;
  border-color: #a92f43;
  color: white;
}
.layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 292px;
  gap: 28px;
}
.card {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 22px;
  overflow: hidden;
}
.vote-home + .section-title,
.contest-banners + .section-title,
.home-contests + .section-title,
.home-goods + .section-title {
  margin-top: 40px;
}
/* ホームの「コンテスト」欄：最新コンテストのメインビジュアルを大きく、その下に残りのコンテストを平铺 */
.home-contests {
  display: grid;
  gap: 20px;
}
.home-contests .vote-latest {
  min-height: 380px;
}
/* ホームの「グッズ」欄：投票中の作品図をランダムに数点。押すと投票ページ。名前や数は出さない。
   図の縦横比は作品ごとに違うので、枠いっぱいに切り抜いてどのカードも同じ高さに見せる */
.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: 14px;
  overflow: hidden;
  background: radial-gradient(circle at 50% 35%, #fff, #e9ecf8);
  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;
}
.home-contests .contest-banners {
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
}
.contest-banners {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 20px;
}
.contest-banner {
  position: relative;
  display: block;
  min-height: 200px;
  border-radius: 22px;
  overflow: hidden;
  background: #202944;
  color: #fff;
}
.contest-banner-link {
  position: absolute;
  inset: 0;
  color: inherit;
}
.contest-banner-join {
  position: absolute;
  top: 14px;
  right: 14px;
  z-index: 1;
  padding: 7px 14px;
  border-radius: 999px;
  background: #fff;
  color: #202437;
  font-size: 13px;
  font-weight: 700;
  box-shadow: 0 4px 14px #0d122640;
}
.contest-banner-join:hover {
  background: #e8ebfc;
}
.contest-banner img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.2s;
}
.contest-banner-link:hover img {
  transform: scale(1.03);
}
.contest-banner-copy {
  position: absolute;
  inset: auto 0 0;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 6px;
  padding: 56px 22px 20px;
  background: linear-gradient(transparent, #161c33e6);
}
.contest-banner strong {
  font-size: 19px;
  line-height: 1.4;
  overflow-wrap: anywhere;
}
.contest-banner small {
  color: #e3e6fb;
  font-size: 13px;
}
#app > .section-title:first-child {
  margin-top: 0;
}
.vote-home {
  display: grid;
  gap: 20px;
}
.vote-latest {
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  min-height: 320px;
  border-radius: 22px;
  overflow: hidden;
  background: #202944;
  color: #fff;
}
.vote-latest img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.vote-latest-copy {
  position: relative;
  padding: 80px 32px 28px;
  background: linear-gradient(transparent, #161c33e6);
}
.vote-latest-tag {
  display: inline-block;
  padding: 4px 10px;
  border-radius: 6px;
  background: #fff;
  color: #323f78;
  font-size: 13px;
  font-weight: 700;
}
.vote-latest h3 {
  margin: 10px 0 4px;
  font-size: 28px;
  line-height: 1.4;
  overflow-wrap: anywhere;
}
.vote-latest p {
  margin: 0;
  color: #e3e6fb;
  font-size: 14px;
}
.vote-latest-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 16px;
}
.vote-latest-actions a {
  padding: 10px 20px;
  border-radius: 999px;
  border: 1px solid #ffffff99;
  color: #fff;
  font-weight: 700;
  font-size: 14px;
}
.vote-latest-actions .vote-latest-go {
  border-color: #fff;
  background: #fff;
  color: #323f78;
}
/* The current first place of the contest in voting: a large square on the right of the cover (below the buttons on phones). */
.vote-latest.has-first .vote-latest-copy {
  padding-right: 300px;
}
.vote-latest-top {
  position: absolute;
  right: 32px;
  bottom: 28px;
  width: 236px;
  aspect-ratio: 1;
  overflow: hidden;
  border: 3px solid #fff;
  border-radius: 18px;
  background: #eef0f7;
  box-shadow: 0 14px 34px #0b102640;
}
.vote-latest-top img {
  position: static;
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: 50% 15%;
  transition: transform 0.2s;
}
.vote-latest-top:hover img {
  transform: scale(1.04);
}
.vote-latest-top-tag {
  position: absolute;
  top: 10px;
  left: 10px;
  padding: 4px 10px;
  border-radius: 999px;
  background: var(--blue, #5261ee);
  color: #fff;
  font-size: 12px;
  font-weight: 800;
}
.vote-entry {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 30px 32px;
  border: 0;
  background: linear-gradient(120deg, #202944, #3a47b8 70%, #5261ee);
  color: #fff;
}
.vote-entry .eyebrow {
  color: #c9cff8;
}
.vote-entry h3 {
  margin: 8px 0 6px;
  font-size: 24px;
  line-height: 1.4;
}
.vote-entry p {
  margin: 0;
  color: #e3e6fb;
  font-size: 14px;
}
.vote-entry-go {
  flex: none;
  padding: 12px 22px;
  border-radius: 999px;
  background: #fff;
  color: #323f78;
  font-weight: 700;
  font-size: 15px;
}
.vote-entry:hover .vote-entry-go {
  background: #eef0ff;
}
.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 #bac1ed;
  background: #f8f9ff;
  min-height: 240px;
}
.shelf-new:hover {
  background: #f1f3ff;
}
.shelf-phone,
.shelf-phone:hover {
  background: #f8f9ff;
  color: #5f6878;
}
.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: #646e85;
}
.section-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin: 30px 0 18px;
}
.section-title a {
  font-size: 14px;
  color: var(--blue);
}
.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: #e9edf4;
}
.info {
  padding: 17px 20px 0;
}
.meta {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: #646e85;
  margin-top: 12px;
}
.mini-avatar {
  width: 25px;
  height: 25px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-size: 12px;
  flex: none;
}
.badge {
  font-size: 12px;
  color: #646e85;
  border: 1px solid #e0e4ed;
  border-radius: 6px;
  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: #646e85;
  font-size: 12px;
}
.workshop-link {
  display: block;
  margin-top: 24px;
  color: var(--blue);
  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: #fafbff;
}
.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: #525d7a;
  margin-bottom: 9px;
}
.empty p {
  max-width: 460px;
  margin: 0 auto 22px;
  font-size: 14px;
}
.empty-icon {
  font-size: 26px;
  color: #8494dc;
  margin-bottom: 18px;
}
.loading {
  padding: 60px;
  text-align: center;
  color: #646e85;
}
.tabs {
  display: flex;
  gap: 7px;
  margin-bottom: 24px;
}
.tabs button {
  font-size: 14px;
  background: transparent;
  border: 0;
  padding: 10px 17px;
}
.tabs .active {
  background: #e8ebfc;
  color: #4758d9;
}
.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 #bec5fa;
}
.form-card {
  max-width: 740px;
  padding: 36px;
}
.field {
  display: block;
  margin: 24px 0;
}
.field span {
  display: block;
  font-size: 14px;
  color: #646e85;
  margin-bottom: 10px;
}
input,
textarea,
select {
  border: 1px solid #dfe4ee;
  background: #fafbfe;
  border-radius: 10px;
  padding: 13px;
  color: #202437;
  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: #47516d;
  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: #56627c;
}
.thread form textarea {
  width: 100%;
  min-height: 96px;
  margin: 16px 0 0;
  resize: vertical;
}
.back {
  display: inline-block;
  margin-bottom: 22px;
  color: #646e85;
  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 {
  color: var(--blue);
}
#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: 14px;
  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: 24px;
  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: #f7f8fb;
  }
  .searching .search-field:focus-within {
    border-color: #bac1ed;
    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: #646e85;
  }
  .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 show the short tab names: 工房, 投票. */
  .nav-long {
    display: none;
  }
  /* Phones: logo and tools on the first row, the tab capsule across the second. */
  :root {
    --header-h: 96px;
  }
  .site-header {
    grid-template-columns: minmax(0, 1fr) auto;
    grid-template-rows: 50px 36px;
    gap: 0 10px;
    --header-pad: 12px;
    padding-bottom: 10px;
  }
  .site-header nav {
    grid-column: 1 / -1;
    grid-row: 2;
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    padding: 3px;
    font-size: 13px;
  }
  .site-header nav a {
    padding: 6px 0;
  }
  .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;
  }
  .contest-banners,
  .home-contests .contest-banners {
    grid-template-columns: none;
    grid-auto-flow: column;
    grid-auto-columns: 84%;
    gap: 12px;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
  }
  .contest-banner {
    min-height: 170px;
    scroll-snap-align: start;
  }
  .home-goods {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 8px;
  }
  .vote-latest {
    min-height: 260px;
  }
  .vote-latest-copy,
  .vote-latest.has-first .vote-latest-copy {
    padding: 60px 20px 20px;
  }
  .vote-latest-top {
    position: relative;
    right: auto;
    bottom: auto;
    display: block;
    width: 150px;
    margin-top: 16px;
    border-radius: 14px;
  }
  .vote-latest h3 {
    font-size: 21px;
  }
  .vote-latest-actions {
    gap: 8px;
  }
  .vote-latest-actions a {
    padding: 9px 16px;
    font-size: 13px;
  }
  .vote-entry {
    flex-direction: column;
    align-items: stretch;
    padding: 24px 20px;
  }
  .vote-entry h3 {
    font-size: 20px;
  }
  .vote-entry-go {
    text-align: center;
  }
  .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: 0;
    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;
  }
  body:has(.vote-stage) #notice {
    bottom: calc(96px + 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: 8px;
  background: none;
  color: #646e85;
  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: #f1f3ff;
  color: #4758d9;
}
.post-actions .icon {
  flex: none;
  width: 16px;
  height: 16px;
}
.thread .post-actions [aria-pressed='true'] {
  color: #4758d9;
}
.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: #f1f3ff;
  margin: 0 -16px;
  padding-left: 16px;
  padding-right: 16px;
}
.comment .author {
  color: #202437;
  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: #8a93a8;
  text-decoration: none;
  font-variant-numeric: tabular-nums;
}
.comment .edited {
  font-size: 12px;
  color: #8a93a8;
}
.tag.hidden-tag {
  color: #9a3412;
  background: #ffedd5;
}
.hidden-floor .floor-body,
.hidden-floor .quote {
  opacity: 0.6;
}
.comment.removed .removed-note {
  color: #8a93a8;
  font-size: 14px;
  font-style: italic;
}
.comment a.mention {
  color: var(--blue);
  text-decoration: none;
}
.quote {
  margin: 8px 0 0;
  padding: 8px 12px;
  border-left: 3px solid #c9cee0;
  background: #f7f8fb;
  border-radius: 0 8px 8px 0;
  font-size: 14px;
}
.quote a {
  color: #646e85;
  font-weight: 600;
  text-decoration: none;
}
.quote p {
  margin: 4px 0 0;
  color: #646e85;
  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: 8px;
  background: none;
  color: #8a93a8;
}
.floor-actions button:hover,
.floor-actions button:focus-visible {
  background: #f1f3ff;
  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: 6px;
  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: #f5f6ff;
  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: #8a93a8;
}
/* 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: #646e85;
  margin: 0;
}
.search-filter {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 4px 6px;
  font-size: 14px;
  color: #646e85;
  margin: -6px 0 14px;
}
.search-filter .tag {
  margin: 0;
}
.search-filter a {
  color: var(--blue);
  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: 999px;
  color: #525d7a;
  white-space: nowrap;
}
.search-tabs a:hover {
  background: #eceefa;
}
.search-tabs a.active {
  background: #e8ebfc;
  color: #4758d9;
}
.search-tabs small,
.search-group h2 small {
  margin-left: 6px;
  color: #8a93a8;
  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: 18px;
}
.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(--blue);
  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: #fafbff;
}
.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: #646e85;
  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: #8a93a8;
  font-size: 11px;
}
.search-row .chip:hover {
  border-color: #bac1ed;
}
.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: 8px;
  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: #646e85;
  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: 16px;
  }
  .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 {
  color: var(--blue);
}
.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: #646e85;
}
.admin-floor .floor-no {
  margin-left: 0;
  font-weight: 700;
  color: #4b5468;
}
.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: #8a93a8;
  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;
  }
}
