.char-screenshots-section {
  margin-top: 0;
}

.char-contribute-details {
  margin-top: 1.25rem;
  padding: 0;
  border: var(--ct-window-border);
  box-shadow: var(--ct-window-shadow);
  overflow: hidden;
}

.char-contribute-summary {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  padding: 0.95rem 1.1rem;
  cursor: pointer;
  list-style: none;
}

.char-contribute-summary::-webkit-details-marker {
  display: none;
}

.char-contribute-summary::after {
  content: '▸';
  flex-shrink: 0;
  margin-left: auto;
  font-size: 0.8rem;
  color: #94a3b8;
  transition: transform 0.15s ease;
}

.char-contribute-details[open] > .char-contribute-summary::after {
  transform: rotate(90deg);
}

.char-contribute-summary-main {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
  min-width: 0;
}

.char-contribute-summary-title {
  font-size: 1.1rem;
  font-weight: 700;
  color: #111827;
}

.char-contribute-summary-note {
  font-size: 0.8rem;
  color: #6b7280;
}

.char-contribute-summary-badge {
  flex-shrink: 0;
  padding: 0.15rem 0.55rem;
  border-radius: 9999px;
  font-size: 0.72rem;
  font-weight: 700;
  line-height: 1.35;
  background: #fef3c7;
  color: #92400e;
  border: 1px solid #fde68a;
}

.char-contribute-details.is-needs-help > .char-contribute-summary {
  background: linear-gradient(135deg, #faf5ff 0%, #fff 70%);
  border-bottom: 1px solid #ede9fe;
}

.char-contribute-details.is-needs-help .char-contribute-summary-title {
  color: #5b21b6;
}

.char-screenshots-section.char-contribute-hub {
  border: none;
  box-shadow: none;
  background: transparent;
  padding: 0 1.1rem 1.1rem;
}

.char-contribute-guide-stage {
  margin-bottom: 0.85rem;
}

.char-contribute-head {
  margin-bottom: 0.75rem;
}

.char-contribute-head .section-title {
  margin-bottom: 0.35rem;
}

.char-contribute-lead {
  margin: 0 0 0.6rem;
}

/* 編集協力一覧と同じタグ（武将個別ページは wiki-contribute.css を読まないためここで定義） */
.contribute-theme .cw-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 0.3rem;
}

.contribute-theme .cw-pill {
  display: inline-block;
  padding: 0.12rem 0.5rem;
  font-size: 0.72rem;
  font-weight: 600;
  border-radius: 9999px;
  background: var(--ct-violet-100);
  color: var(--ct-violet-800);
}

.contribute-theme .cw-pill--stats {
  background: #fef3c7;
  color: #92400e;
}

.contribute-theme .cw-pill--heishu {
  background: #dbeafe;
  color: #1e40af;
}

.contribute-theme .cw-pill--skills {
  background: #fce7f3;
  color: #9d174d;
}

.contribute-theme .cw-pill--combo {
  background: #e0e7ff;
  color: #3730a3;
}

.contribute-theme .cw-pill--detail {
  background: #ecfdf5;
  color: #047857;
}

.contribute-theme .cw-pill--request {
  background: #ffedd5;
  color: #9a3412;
}

.contribute-theme .cg-bubble-wrap .char-contribute-issue-pills {
  margin-top: 0.55rem;
}

.char-contribute-fallback-notice {
  margin: 0.5rem 0 0;
  padding: 0.55rem 0.75rem;
  border-radius: 8px;
  background: #fff7ed;
  color: #9a3412;
  font-size: 0.82rem;
}

.char-contribute-guide {
  margin-bottom: 0.85rem;
}

.char-contribute-subpanel {
  margin-top: 0.85rem;
  border: var(--ct-window-border);
  border-radius: 14px;
  background: linear-gradient(160deg, var(--ct-violet-50, #f5f3ff) 0%, #faf5ff 55%, #fff 100%);
  box-shadow: var(--ct-window-shadow);
  overflow: hidden;
}

.char-contribute-subpanel[hidden] {
  display: none !important;
}

.char-contribute-subpanel-stage.cg-stage {
  margin: 0;
  border: none;
  border-radius: 0;
  box-shadow: none;
  border-bottom: var(--ct-window-divider);
}

.char-contribute-subpanel-body {
  padding: 0.85rem 1rem 1rem;
}

.char-contribute-screenshot-panel,
.char-contribute-portrait-panel {
  margin: 0;
  padding: 0;
  border: none;
}

.char-screenshots-portrait-head {
  margin-bottom: 0.75rem;
}

.char-screenshots-portrait-lead {
  margin: 0;
  line-height: 1.55;
}

.char-screenshots-portrait-grid-title {
  margin: 1rem 0 0.5rem;
  font-size: 0.92rem;
  font-weight: 700;
  color: #374151;
}

.char-screenshots-upload--portrait {
  margin-bottom: 0.5rem;
  padding-bottom: 0.75rem;
  border-bottom: 1px solid #e5e7eb;
}

.char-screenshots-portrait-forbidden {
  margin: 0;
  padding: 0.65rem 0.75rem;
  border-radius: 8px;
  background: #fef2f2;
  color: #991b1b;
}

.char-contribute-comment-form {
  margin: 0;
  padding: 0;
  border: none;
  border-radius: 0;
  background: transparent;
}

.char-contribute-comment-label {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  margin-bottom: 0.65rem;
  font-size: 0.82rem;
  font-weight: 700;
  color: #374151;
}

.char-contribute-comment-label textarea,
.char-contribute-comment-label input {
  font: inherit;
  font-weight: 400;
  padding: 0.55rem 0.65rem;
  border: 1px solid #cbd5e1;
  border-radius: 8px;
  background: #fff;
}

.char-contribute-comment-label textarea {
  resize: vertical;
  min-height: 5.5rem;
  line-height: 1.55;
}

.char-contribute-comment-form .char-screenshots-request-edit,
.char-screenshots-upload--hub .char-screenshots-request-edit {
  margin-bottom: 0.75rem;
}

.char-screenshots-upload--hub {
  margin: 0 0 0.75rem;
  padding: 0;
  background: transparent;
  border: none;
  border-radius: 0;
  box-shadow: none;
  overflow: visible;
}

.char-screenshots-file-drop--hub {
  background: #fff;
  border-color: #cbd5e1;
}

.char-screenshots-file-drop--hub:hover,
.char-screenshots-file-drop--hub:focus-within {
  border-color: #a78bfa;
  background: #faf5ff;
}

.char-screenshots-file-drop--hub.has-file {
  border-style: solid;
  border-color: #c4b5fd;
  background: #f5f3ff;
}

.char-screenshots-upload--hub .char-screenshots-file-icon {
  background-color: #ede9fe;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke='%235b21b6' stroke-width='1.5'%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' d='m2.25 15.75 5.159-5.159a2.25 2.25 0 0 1 3.182 0l5.159 5.159m-1.5-1.5 1.409-1.409a2.25 2.25 0 0 1 3.182 0l2.909 2.909M3.75 21h16.5A2.25 2.25 0 0 0 22.5 18.75V5.25A2.25 2.25 0 0 0 20.25 3H3.75A2.25 2.25 0 0 0 1.5 5.25v13.5A2.25 2.25 0 0 0 3.75 21Z'/%3E%3C/svg%3E");
}

.char-screenshots-upload--hub .char-screenshots-file-prompt strong {
  color: #5b21b6;
}

.char-screenshots-upload--hub .char-screenshots-file-name {
  color: #5b21b6;
  background: #ede9fe;
}

.char-contribute-comment-foot {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem 0.75rem;
}

.char-contribute-comment-msg.is-error {
  color: #b91c1c;
}

.char-contribute-actions {
  margin-top: 0.15rem;
}

.char-formation-loading,
.char-contribute-loading {
  margin: 0.5rem 0;
}

.char-screenshots-head--hub {
  margin-bottom: 0.85rem;
}

.char-screenshots-subtitle {
  margin: 0;
  font-size: 1rem;
  font-weight: 700;
  color: #111827;
}

.char-screenshots-head {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.5rem;
  margin-bottom: 1rem;
  padding-bottom: 0.5rem;
  border-bottom: 1px solid #e5e7eb;
}

.char-screenshots-head h2 {
  margin: 0;
  font-size: 1.15rem;
  font-weight: 700;
  color: #111827;
}

/* --- 投稿フォーム --- */

.char-screenshots-upload {
  margin-bottom: 1.25rem;
  padding: 0;
  background: #fff;
  border: 1px solid #e5e7eb;
  border-radius: 12px;
  box-shadow: 0 1px 3px rgba(15, 23, 42, 0.06);
  overflow: hidden;
}

.char-screenshots-upload-head {
  padding: 1rem 1.15rem 0.85rem;
  background: linear-gradient(180deg, #f0fdf4 0%, #fff 100%);
  border-bottom: 1px solid #ecfdf5;
}

.char-screenshots-upload-title {
  margin: 0 0 0.35rem;
  font-size: 1rem;
  font-weight: 700;
  color: #166534;
}

.char-screenshots-upload-lead {
  margin: 0;
  font-size: 0.8125rem;
  line-height: 1.55;
  color: #4b5563;
}

.char-screenshots-upload-body {
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
  padding: 1rem 1.15rem;
}

.char-screenshots-field-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.75rem 1rem;
}

@media (max-width: 560px) {
  .char-screenshots-field-grid {
    grid-template-columns: 1fr;
  }
}

.char-screenshots-field {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  margin: 0;
}

.char-screenshots-field-label {
  font-size: 0.75rem;
  font-weight: 600;
  color: #374151;
  letter-spacing: 0.02em;
}

.char-screenshots-optional {
  font-weight: 500;
  color: #9ca3af;
}

.char-screenshots-input {
  width: 100%;
  padding: 0.5rem 0.65rem;
  font-size: 0.875rem;
  border: 1px solid #d1d5db;
  border-radius: 8px;
  background: #fff;
  transition: border-color 0.15s, box-shadow 0.15s;
}

.char-screenshots-input:focus {
  outline: none;
  border-color: #16a34a;
  box-shadow: 0 0 0 3px rgba(22, 163, 74, 0.15);
}

.char-screenshots-request-edit {
  display: flex;
  align-items: flex-start;
  gap: 0.65rem;
  margin: 0;
  padding: 0.75rem 0.85rem;
  background: #fdf2f8;
  border: 1px solid #fbcfe8;
  border-radius: 10px;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s;
}

.char-screenshots-request-edit:hover {
  background: #fce7f3;
  border-color: #f9a8d4;
}

.char-screenshots-request-edit input[type='checkbox'] {
  flex-shrink: 0;
  width: 1.1rem;
  height: 1.1rem;
  margin: 0.15rem 0 0;
  accent-color: #db2777;
}

.char-screenshots-request-edit-text {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
  font-size: 0.8125rem;
  line-height: 1.45;
  color: #831843;
}

.char-screenshots-request-edit-text strong {
  font-size: 0.875rem;
  color: #9d174d;
}

.char-screenshots-request-edit-text span {
  color: #be185d;
  font-size: 0.75rem;
}

.char-screenshots-file-drop {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.25rem;
  margin: 0;
  padding: 1.35rem 1rem;
  text-align: center;
  background: #f9fafb;
  border: 2px dashed #d1d5db;
  border-radius: 10px;
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s, box-shadow 0.15s;
}

.char-screenshots-file-drop:hover,
.char-screenshots-file-drop:focus-within {
  border-color: #16a34a;
  background: #f0fdf4;
}

.char-screenshots-file-drop.has-file {
  border-style: solid;
  border-color: #86efac;
  background: #f0fdf4;
}

.char-screenshots-file-input {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  opacity: 0;
  cursor: pointer;
}

.char-screenshots-file-icon {
  display: block;
  width: 2.75rem;
  height: 2.75rem;
  margin: 0 auto 0.15rem;
  border-radius: 10px;
  background: #dcfce7
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke='%23166534' stroke-width='1.5'%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' d='m2.25 15.75 5.159-5.159a2.25 2.25 0 0 1 3.182 0l5.159 5.159m-1.5-1.5 1.409-1.409a2.25 2.25 0 0 1 3.182 0l2.909 2.909M3.75 21h16.5A2.25 2.25 0 0 0 22.5 18.75V5.25A2.25 2.25 0 0 0 20.25 3H3.75A2.25 2.25 0 0 0 1.5 5.25v13.5A2.25 2.25 0 0 0 3.75 21Z'/%3E%3C/svg%3E")
    center / 1.5rem no-repeat;
}

.char-screenshots-file-prompt {
  font-size: 0.875rem;
  color: #374151;
}

.char-screenshots-file-prompt strong {
  color: #15803d;
}

.char-screenshots-file-spec {
  font-size: 0.75rem;
  color: #9ca3af;
}

.char-screenshots-file-name {
  margin-top: 0.35rem;
  padding: 0.2rem 0.55rem;
  max-width: 100%;
  font-size: 0.75rem;
  font-weight: 600;
  color: #166534;
  background: #dcfce7;
  border-radius: 999px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.char-screenshots-file-drop:not(.has-file) .char-screenshots-file-name {
  color: #6b7280;
  font-weight: 500;
  background: transparent;
}

.char-screenshots-upload-foot {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.75rem 1rem;
  padding: 0.85rem 1.15rem;
  background: #f9fafb;
  border-top: 1px solid #e5e7eb;
}

.char-screenshots-upload-foot .btn {
  margin: 0;
  min-width: 8rem;
}

.char-screenshots-upload-msg {
  flex: 1 1 12rem;
  margin: 0;
  min-height: 1.25rem;
  font-size: 0.8125rem;
  color: #6b7280;
}

.char-screenshots-upload-msg:not(:empty) {
  color: #15803d;
  font-weight: 500;
}

.char-screenshots-upload-msg.is-error {
  color: #b91c1c;
}

/* --- 投稿一覧 --- */

.char-screenshots-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 0.65rem;
}

.char-screenshot-card {
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  overflow: hidden;
  background: #fff;
}

.char-screenshot-card.is-published {
  border-color: #86efac;
}

.char-screenshot-card.is-rejected {
  opacity: 0.55;
}

.char-screenshot-card button.char-screenshot-thumb {
  display: block;
  width: 100%;
  padding: 0;
  border: none;
  background: #111827;
  cursor: zoom-in;
}

.char-screenshot-card img {
  display: block;
  width: 100%;
  height: 120px;
  object-fit: contain;
  background: #1f2937;
}

.char-screenshot-meta {
  padding: 0.4rem 0.5rem;
  font-size: 0.7rem;
  color: #6b7280;
  line-height: 1.35;
}

.char-screenshot-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  padding: 0 0.5rem 0.5rem;
}

.char-screenshot-actions .btn,
.char-screenshot-actions .btn-secondary {
  font-size: 0.7rem;
  padding: 0.2rem 0.45rem;
}

.char-screenshots-edit-dock {
  margin: 0 0 1rem;
  padding: 0.65rem 0.75rem;
  background: #eff6ff;
  border: 1px solid #bfdbfe;
  border-radius: 8px;
}

.char-screenshots-edit-dock-title {
  font-size: 0.8rem;
  font-weight: 600;
  color: #1e40af;
  margin-bottom: 0.45rem;
}

.char-screenshots-edit-strip {
  display: flex;
  gap: 0.5rem;
  overflow-x: auto;
  padding-bottom: 0.25rem;
}

.char-screenshots-edit-strip img {
  height: 72px;
  width: auto;
  max-width: 120px;
  object-fit: contain;
  border-radius: 4px;
  border: 1px solid #93c5fd;
  cursor: zoom-in;
  background: #1f2937;
}

.char-screenshots-empty {
  color: #6b7280;
  font-size: 0.875rem;
  padding: 0.5rem 0;
}

.char-screenshot-modal {
  position: fixed;
  inset: 0;
  z-index: 1200;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  background: rgba(0, 0, 0, 0.65);
}

.char-screenshot-modal[hidden] {
  display: none;
}

.char-screenshot-modal-panel {
  width: min(960px, 100%);
  max-height: 92vh;
  overflow: auto;
  background: #fff;
  border-radius: 10px;
  padding: 1rem;
}

.char-screenshot-crop-wrap {
  position: relative;
  display: inline-block;
  max-width: 100%;
  user-select: none;
  touch-action: none;
}

.char-screenshot-crop-wrap img {
  max-width: 100%;
  max-height: 60vh;
  display: block;
}

.char-screenshot-crop-rect {
  position: absolute;
  border: 2px solid #3b82f6;
  background: rgba(59, 130, 246, 0.2);
  box-shadow: 0 0 0 9999px rgba(0, 0, 0, 0.35);
  pointer-events: none;
}

.char-screenshot-crop-tools {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 1rem;
  align-items: center;
  margin-top: 0.75rem;
}

.char-screenshot-crop-tools label {
  font-size: 0.75rem;
  color: #6b7280;
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
}

.char-screenshot-crop-tools input[type='number'] {
  width: 4.5rem;
  padding: 0.2rem 0.35rem;
}

.char-screenshot-crop-tools input[readonly] {
  background: #f9fafb;
  color: #6b7280;
}

.char-screenshot-crop-hint {
  margin: 0 0 0.65rem;
}

.char-screenshot-crop-actions {
  margin-top: 0.75rem;
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
  align-items: center;
}

.char-screenshots-edit-strip-item {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  align-items: stretch;
  min-width: 0;
}

.char-screenshots-edit-strip-thumb {
  padding: 0;
  border: none;
  background: none;
  cursor: pointer;
  border-radius: 6px;
  overflow: hidden;
}

.char-screenshots-edit-strip-thumb img {
  display: block;
  width: 72px;
  height: 72px;
  object-fit: cover;
}

.char-screenshots-edit-strip-crop {
  font-size: 0.72rem;
  padding: 0.15rem 0.35rem;
}

.char-screenshot-picker {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
  gap: 0.65rem;
  margin: 0.75rem 0;
}

.char-screenshot-picker-item {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  padding: 0.35rem;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  background: #fff;
  cursor: pointer;
  text-align: left;
}

.char-screenshot-picker-item:hover {
  border-color: #a78bfa;
  box-shadow: 0 2px 8px rgba(91, 33, 182, 0.12);
}

.char-screenshot-picker-item img {
  width: 100%;
  aspect-ratio: 3 / 4;
  object-fit: cover;
  border-radius: 6px;
}

.char-screenshot-picker-label {
  font-size: 0.75rem;
  color: #6b7280;
}

.char-screenshot-preview {
  margin-top: 0.75rem;
}

.char-screenshot-preview img {
  max-height: 200px;
  border: 1px solid #e5e7eb;
  border-radius: 6px;
}
