:root {
  --bg: #ffffff;
  --text: #111111;
  --muted: #666666;
  --line: #e3e3e3;
  --soft: #f6f6f6;
  --accent: #111111;
  --danger: #b00020;
  --success: #0a7a3b;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: "Avenir Next", "Avenir", "Century Gothic", sans-serif;
  color: var(--text);
  background: var(--bg);
}

.site-header {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 24px 6vw 8px;
}

.site-logo {
  height: 96px;
  width: auto;
}

.site-title {
  font-size: 1.35rem;
  font-weight: 600;
  letter-spacing: 0.02em;
}

.container {
  max-width: 880px;
  margin: 0 auto;
  padding: 16px 6vw 80px;
}

.panel {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 24px;
  background: #ffffff;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.04);
}

.panel + .panel {
  margin-top: 24px;
}

h1 {
  margin: 0 0 8px;
  font-size: 1.4rem;
}

.section {
  margin-top: 32px;
  padding-top: 8px;
  border-top: 1px solid var(--line);
}

.section h2 {
  margin: 0 0 12px;
  font-size: 1.1rem;
}

.field {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 18px;
}

.field label {
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 8px;
}

.checkbox-label {
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 10px;
}

.checkbox-label input[type="checkbox"] {
  margin: 0;
}

.field-info {
  font-weight: 500;
  line-height: 1.4;
}

.field input,
.field textarea,
.field select {
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 10px 12px;
  font-size: 0.98rem;
  background: #ffffff;
}

.field textarea {
  min-height: 110px;
  resize: vertical;
}

.field-help {
  margin: 0;
  color: var(--muted);
}

.field-links {
  margin-top: -2px;
  line-height: 1.35;
}

.field-links a {
  color: var(--muted);
  text-underline-offset: 2px;
}

.field-links a:hover {
  color: var(--text);
}

.quick-add-wrap {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.quick-add-buttons {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.quick-add-btn {
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 6px 10px;
  font-size: 0.84rem;
  line-height: 1.2;
  background: var(--soft);
  color: var(--text);
}

.quick-add-btn:hover:enabled {
  background: #efefef;
}

.field--missing input,
.field--missing textarea,
.field--missing select {
  border-color: var(--danger);
  background: #fff5f6;
}

.actions {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  margin-top: 16px;
}

button {
  border: none;
  border-radius: 6px;
  padding: 10px 16px;
  background: var(--accent);
  color: #ffffff;
  font-size: 0.95rem;
  cursor: pointer;
}

button:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

button.ghost {
  background: var(--soft);
  color: var(--text);
  border: 1px solid var(--line);
}

.validate-toggle {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--soft);
  color: var(--text);
  font-size: 0.95rem;
  cursor: pointer;
}

.validate-toggle input[type="checkbox"] {
  margin: 0;
}

.validate-toggle input[type="checkbox"]:disabled + span {
  opacity: 0.6;
}

.progress-wrap {
  margin: 18px 0 24px;
}

.progress-bar {
  width: 100%;
  height: 10px;
  border-radius: 999px;
  background: var(--soft);
  overflow: hidden;
}

.progress-fill {
  height: 100%;
  width: 0%;
  background: var(--accent);
  transition: width 0.2s ease;
}

.project-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
}

.admin-panel {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin: 8px 0 16px;
}

.admin-panel select {
  max-width: 360px;
}

.status {
  margin: 8px 0 0;
  font-size: 0.95rem;
}

.notice {
  border: 1px solid var(--line);
  background: var(--soft);
  padding: 12px 16px;
  border-radius: 6px;
  margin-bottom: 16px;
  font-size: 0.95rem;
}

.notice-error {
  border-color: #efc2c7;
  background: #fff2f4;
  color: #7a0015;
}

.notice code {
  background: #ffffff;
  padding: 1px 4px;
  border-radius: 4px;
  border: 1px solid var(--line);
}

.muted {
  color: var(--muted);
}

.small {
  font-size: 0.9rem;
}

.mono {
  font-family: "SFMono-Regular", "Menlo", "Consolas", monospace;
}

.hidden {
  display: none;
}

.tooltip {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  font-size: 0.75rem;
  background: var(--soft);
  border: 1px solid var(--line);
  color: var(--muted);
}

.upload-wrap {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.upload-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.small-btn {
  padding: 6px 10px;
  font-size: 0.85rem;
}

.upload-progress {
  width: 100%;
  height: 8px;
  border-radius: 999px;
  background: var(--soft);
  overflow: hidden;
}

.upload-progress-fill {
  height: 100%;
  width: 0%;
  background: var(--accent);
  transition: width 0.15s ease;
}

.upload-preview {
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  border: 1px solid var(--line);
  border-radius: 6px;
}

.upload-gallery {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 12px;
}

.upload-doc-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.upload-doc-item {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
  padding: 8px 10px;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.upload-card {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
  padding: 8px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.upload-caption {
  word-break: break-all;
}

.upload-rank-badge {
  font-size: 0.8rem;
  color: var(--muted);
  background: var(--soft);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 3px 8px;
  width: fit-content;
}

.upload-rank-badge.is-active {
  color: #ffffff;
  background: var(--accent);
  border-color: var(--accent);
}

.upload-rank-actions {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

.upload-rank-actions .small-btn.is-selected {
  color: #ffffff;
  background: var(--accent);
  border-color: var(--accent);
}

.unlock-row {
  margin-top: 10px;
  display: flex;
  justify-content: flex-start;
}

button.danger {
  background: var(--danger);
  color: #ffffff;
  border: 1px solid #8b0019;
}

.unlock-btn {
  font-size: 1rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  padding: 12px 18px;
}

@media (max-width: 640px) {
  .site-logo {
    height: 80px;
  }

  .site-header {
    flex-direction: column;
    align-items: flex-start;
  }

  .project-meta {
    flex-direction: column;
    align-items: flex-start;
    gap: 12px;
  }

  .actions {
    flex-direction: column;
    align-items: stretch;
  }
}
