* {
  box-sizing: border-box;
}

:root {
  --bg: #f6f2eb;
  --paper: #fcfaf6;
  --paper-2: #f2ece3;
  --line: #ddd3c5;
  --text: #201c17;
  --muted: #655b52;
  --muted-2: #8a7f74;
  --accent: #2a241f;
  --accent-hover: #3a322b;
  --shadow: 0 10px 30px rgba(32, 28, 23, 0.06);
}

html {
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: var(--text);
  background:
    linear-gradient(to bottom, #f8f4ee 0%, #f6f2eb 220px, #f6f2eb 100%);
  line-height: 1.7;
}

img {
  max-width: 100%;
  display: block;
}

a {
  color: inherit;
  text-decoration: none;
}

.container {
  width: min(1120px, calc(100% - 40px));
  margin: 0 auto;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 1000;
  backdrop-filter: blur(10px);
  background: #fcfaf6;
  border-bottom: 1px solid rgba(221, 211, 197, 0.9);
}

.site-logo {
  display: inline-block;
  padding: 18px 0;
  font-size: 19px;
  font-weight: 700;
  letter-spacing: 0.02em;
}

.hero {
  padding: 72px 0 48px;
}

.hero .container {
  background: rgba(252, 250, 246, 0.72);
  border: 1px solid rgba(221, 211, 197, 0.95);
  border-radius: 28px;
  padding: 44px;
  box-shadow: var(--shadow);
}

.eyebrow {
  margin: 0 0 16px;
  font-size: 32px;
  font-weight: 700;
  color: var(--text);
  letter-spacing: 0.01em;
  text-transform: none;
  line-height: 1.2;
}

.hero h1 {
  margin: 0 0 18px;
  font-size: clamp(2.2rem, 5vw, 4.2rem);
  line-height: 1.14;
  letter-spacing: -0.03em;
}

.lead {
  max-width: 760px;
  margin: 0 0 28px;
  font-size: 1.03rem;
  color: var(--muted);
}

.search-box {
  display: flex;
  gap: 12px;
  align-items: stretch;
  margin-bottom: 14px;
}

.search-box input {
  flex: 1;
  min-width: 0;
  padding: 16px 18px;
  font-size: 16px;
  color: var(--text);
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #fff;
  outline: none;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.8);
}

.search-box input::placeholder {
  color: #94897d;
}

.search-box input:focus {
  border-color: #bcae9c;
  box-shadow: 0 0 0 4px rgba(188, 174, 156, 0.15);
}

.search-box button,
.primary-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 56px;
  padding: 14px 22px;
  border: none;
  border-radius: 14px;
  font-size: 16px;
  font-weight: 700;
  background: var(--accent);
  color: #fff;
  cursor: pointer;
  transition: background 0.2s ease, transform 0.2s ease;
}

.hero-actions {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.hero-actions .primary-button,
.hero-actions .secondary-button {
  min-height: 50px;
}

.secondary-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  padding: 12px 22px;
  border: 1px solid var(--line);
  border-radius: 14px;
  font-size: 16px;
  font-weight: 700;
  background: #f3ecdf;
  color: var(--accent);
  cursor: pointer;
  transition: background 0.2s ease, transform 0.2s ease;
}

.secondary-button:hover {
  background: #eee4d4;
  transform: translateY(-1px);
}

.search-box button:hover,
.primary-button:hover {
  background: var(--accent-hover);
  transform: translateY(-1px);
}

.search-examples {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  align-items: center;
  margin-bottom: 28px;
  color: var(--muted);
  font-size: 14px;
}

.search-examples span {
  color: var(--muted-2);
}

.search-examples a {
  display: inline-flex;
  align-items: center;
  min-height: 34px;
  padding: 4px 12px;
  background: var(--paper-2);
  border: 1px solid #e5dccf;
  border-radius: 999px;
}

.hero-actions {
  margin-top: 2px;
}

.top-links,
.top-status {
  padding: 10px 0 48px;
}

.top-links h2,
.status-box h2 {
  margin-top: 0;
  margin-bottom: 18px;
  font-size: clamp(1.45rem, 3vw, 2rem);
  letter-spacing: -0.02em;
}

.card-grid,
.status-grid {
  display: grid;
  gap: 18px;
}

.card-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.status-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.card,
.status-box {
  background: rgba(252, 250, 246, 0.94);
  border: 1px solid var(--line);
  border-radius: 22px;
  padding: 24px;
  box-shadow: var(--shadow);
}

.card {
  transition: transform 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
}

.card:hover {
  transform: translateY(-2px);
  border-color: #cdbdaa;
  box-shadow: 0 14px 34px rgba(32, 28, 23, 0.08);
}

.card h3 {
  margin: 0 0 10px;
  font-size: 1.35rem;
  letter-spacing: -0.02em;
}

.card p,
.status-box p {
  margin: 0;
  color: var(--muted);
  font-size: 0.98rem;
}

@media (max-width: 900px) {
  .hero {
    padding: 44px 0 30px;
  }

  .hero .container {
    padding: 30px 24px;
    border-radius: 24px;
  }

  .card-grid {
    grid-template-columns: 1fr;
  }

  .status-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 640px) {
  .container {
    width: min(100%, calc(100% - 24px));
  }

  .site-logo {
    padding: 16px 0;
    font-size: 18px;
  }

  .hero {
    padding: 24px 0 18px;
  }

  .hero .container {
    padding: 22px 16px 18px;
    border-radius: 20px;
  }

  .eyebrow {
  margin-bottom: 12px;
  font-size: 28px;
  line-height: 1.2;
  }

  .hero h1 {
    margin-bottom: 14px;
    font-size: 2.3rem;
    line-height: 1.18;
  }

  .lead {
    margin-bottom: 20px;
    font-size: 0.98rem;
  }

  .search-box {
    flex-direction: column;
    gap: 10px;
  }

  .search-box input,
  .search-box button,
  .primary-button {
    width: 100%;
  }

  .search-box input {
    padding: 15px 16px;
    border-radius: 12px;
  }

  .search-box button,
  .primary-button {
    min-height: 52px;
    border-radius: 12px;
  }

  .search-examples {
    gap: 8px;
    margin-bottom: 22px;
    font-size: 13px;
  }

  .search-examples a {
    min-height: 32px;
    padding: 4px 10px;
  }

  .top-links,
  .top-status {
    padding: 8px 0 26px;
  }

  .top-links h2,
  .status-box h2 {
    margin-bottom: 14px;
    font-size: 1.6rem;
  }

  .card,
  .status-box {
    padding: 18px 16px;
    border-radius: 18px;
  }

  .card h3 {
    font-size: 1.18rem;
    margin-bottom: 8px;
  }

  .card p,
  .status-box p {
    font-size: 0.95rem;
  }
}
.page-section {
  padding: 40px 0 56px;
}

.page-header {
  margin-bottom: 24px;
}

.page-eyebrow {
  margin: 0 0 8px;
  font-size: 14px;
  color: var(--muted-2);
  letter-spacing: 0.08em;
}

.page-header h1 {
  margin: 0 0 12px;
  font-size: clamp(2rem, 4vw, 3rem);
  line-height: 1.2;
  letter-spacing: -0.02em;
}

.page-lead {
  margin: 0;
  max-width: 720px;
  color: var(--muted);
}

.form-card {
  background: rgba(252, 250, 246, 0.94);
  border: 1px solid var(--line);
  border-radius: 22px;
  padding: 24px;
  box-shadow: var(--shadow);
}

.item-form {
  display: grid;
  gap: 18px;
}

.form-row {
  display: grid;
  gap: 18px;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.form-group {
  display: grid;
  gap: 8px;
}

.form-group label {
  font-size: 15px;
  font-weight: 700;
  color: var(--text);
}

.form-group input,
.form-group textarea,
.form-group select {
  width: 100%;
  padding: 14px 16px;
  font-size: 16px;
  color: var(--text);
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 14px;
  outline: none;
}

.form-group textarea {
  resize: vertical;
  min-height: 120px;
}

.form-group input:focus,
.form-group textarea:focus,
.form-group select:focus {
  border-color: #bcae9c;
  box-shadow: 0 0 0 4px rgba(188, 174, 156, 0.15);
}

.form-actions {
  padding-top: 6px;
}

@media (max-width: 640px) {
  .page-section {
    padding: 24px 0 34px;
  }

  .page-header {
    margin-bottom: 18px;
  }

  .page-eyebrow {
    font-size: 13px;
  }

  .page-header h1 {
    font-size: 1.9rem;
    margin-bottom: 10px;
  }

  .page-lead {
    font-size: 0.97rem;
  }

  .form-card {
    padding: 18px 16px;
    border-radius: 18px;
  }

  .item-form {
    gap: 16px;
  }

  .form-row {
    grid-template-columns: 1fr;
    gap: 16px;
  }

  .form-group input,
  .form-group textarea,
  .form-group select {
    padding: 13px 14px;
    border-radius: 12px;
  }
}
.search-header {
  margin-bottom: 18px;
}

.search-card {
  margin-bottom: 28px;
}

.search-page-box {
  margin-bottom: 0;
}

.search-section {
  margin-bottom: 22px;
}

.search-section h2 {
  margin: 0 0 12px;
  font-size: 1.35rem;
  letter-spacing: -0.02em;
}

.empty-search-box p {
  margin: 0;
  color: var(--muted);
}

@media (max-width: 640px) {
  .search-card {
    margin-bottom: 20px;
  }

  .search-section {
    margin-bottom: 18px;
  }

  .search-section h2 {
    font-size: 1.2rem;
    margin-bottom: 10px;
  }
}
.brand-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

@media (max-width: 900px) {
  .brand-grid {
    grid-template-columns: 1fr;
  }
}
.media-viewer {
  display: grid;
  gap: 14px;
}

.media-stage {
  position: relative;
  overflow: hidden;
  background: #efe7dc;
  border: 1px solid var(--line);
  border-radius: 22px;
  aspect-ratio: 4 / 3;
}

.media-stage img,
.media-stage video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.media-thumbs {
  display: flex;
  gap: 10px;
  overflow-x: auto;
  padding: 4px;
}

.media-thumb {
  position: relative;
  flex: 0 0 96px;
  width: 96px;
  height: 72px;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 14px;
  overflow: hidden;
  background: #f3ece2;
  cursor: pointer;
}

.media-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.media-thumb::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(to top, rgba(32, 28, 23, 0.08), rgba(32, 28, 23, 0));
  pointer-events: none;
}

.media-thumb.is-active {
  border-color: #7f6d58;
  box-shadow: 0 0 0 4px rgba(127, 109, 88, 0.24);
  transform: translateY(-1px);
}
.media-thumb-badge {
  position: absolute;
  right: 6px;
  bottom: 6px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 24px;
  height: 24px;
  padding: 0 6px;
  border-radius: 999px;
  background: rgba(32, 28, 23, 0.82);
  color: #fff;
  font-size: 12px;
  font-weight: 700;
}

@media (max-width: 640px) {
  .media-stage {
    border-radius: 18px;
  }

  .media-thumb {
    flex: 0 0 84px;
    width: 84px;
    height: 64px;
    border-radius: 12px;
  }
}
.media-stage [hidden] {
  display: none !important;
}
.field-help {
  margin-top: 8px;
  font-size: 14px;
  color: var(--muted-2);
}

.candidate-box {
  margin-top: 12px;
  max-width: 520px;
  padding: 14px;
  background: #fbf8f3;
  border: 1px solid #e7ddd0;
  border-radius: 16px;
}

.candidate-title {
  margin: 0 0 10px;
  font-size: 14px;
  font-weight: 700;
  color: var(--text);
}

.candidate-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.candidate-chip {
  display: inline-flex;
  align-items: center;
  min-height: 36px;
  padding: 7px 12px;
  border: 1px solid #d6c8b8;
  border-radius: 999px;
  background: #fff;
  color: var(--text);
  font-size: 14px;
  cursor: pointer;
}

.candidate-chip.is-selected {
  border-color: #d6c8b8;
  background: #fff;
  font-weight: 400;
}

.candidate-chip-muted {
  background: #fcfaf6;
  color: var(--muted);
}

@media (max-width: 640px) {
  .field-help {
    font-size: 13px;
  }

  .candidate-box {
    padding: 12px;
    border-radius: 14px;
  }

  .candidate-chip {
    min-height: 34px;
    font-size: 13px;
    padding: 6px 10px;
  }
}
.media-delete-option {
  display: inline-flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 4px;
  margin-top: 10px;
  font-size: 14px;
  line-height: 1.5;
  white-space: normal;
}

.media-delete-option input[type="checkbox"] {
  margin: 0;
  flex: 0 0 auto;
  width: auto;
  min-width: 0;
  height: auto;
}

.item-threads {
  margin-top: 28px;
}

.thread-form {
  display: grid;
  gap: 14px;
  margin-top: 14px;
  margin-bottom: 20px;
}

.thread-form .form-row {
  display: grid;
  gap: 6px;
}

.thread-form select,
.thread-form textarea,
.thread-form input {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid #cdbfae;
  border-radius: 10px;
  background: #fffdf9;
  box-sizing: border-box;
}

.thread-form button {
  width: 100%;
}

.thread-list {
  display: grid;
  gap: 12px;
  margin-top: 12px;
  max-width: 100%;
  box-sizing: border-box;
}

.thread-card {
  padding: 14px 16px;
  border: 1px solid #d8ccbd;
  border-radius: 14px;
  background: #fffdf9;
  box-sizing: border-box;
  max-width: 100%;
}

.thread-meta {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  align-items: center;
  margin-bottom: 8px;
}

.thread-tag {
  display: inline-block;
  padding: 4px 10px;
  border-radius: 999px;
  background: #efe7dc;
  font-size: 13px;
  font-weight: 700;
}

.thread-author {
  font-size: 13px;
  color: #6b5f52;
}

.thread-body {
  margin: 0;
  line-height: 1.7;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  word-break: break-word;
}

.thread-empty {
  margin-top: 10px;
  color: #6b5f52;
}

.thread-error {
  margin: 0 0 6px;
  color: #a4382b;
  font-size: 14px;
  font-weight: 700;
}

.thread-success {
  margin: 0 0 14px;
  padding: 10px 14px;
  color: #2f6f3e;
  background: #eef7f0;
  border: 1px solid #b9dec1;
  border-radius: 10px;
  font-size: 15px;
  font-weight: 700;
}

.thread-media {
  margin-top: 12px;
}

.thread-media img,
.thread-media video {
  max-width: 100%;
  border-radius: 14px;
  border: 1px solid #ded2c4;
  display: block;
}

.search-highlight {
  background: #fff2a8;
  color: #2f2823;
  border-radius: 4px;
  padding: 0 3px;
  font-weight: 700;
}

.site-search-sticky {
  width: min(960px, calc(100% - 24px));
  margin: 0 auto 10px;
  padding: 0;
  background: transparent;
  box-sizing: border-box;
}

.site-search-form {
  display: flex;
  gap: 8px;
  width: 100%;
  box-sizing: border-box;
}

.site-search-input {
  flex: 1;
  min-width: 0;
  padding: 12px 14px;
  border: 1px solid #ded2c4;
  border-radius: 12px;
  font-size: 15px;
  box-sizing: border-box;
}

.site-search-button {
  flex: 0 0 auto;
  padding: 12px 16px;
  border: none;
  border-radius: 12px;
  background: #2f2823;
  color: #fff;
  font-weight: 700;
  white-space: nowrap;
}

@media (max-width: 480px) {
  .site-search-sticky {
    margin-top: 8px;
    padding: 0 10px;
  }

  .site-search-input {
    font-size: 14px;
    padding: 11px 12px;
  }

  .site-search-button {
    padding: 11px 12px;
  }
}
@media (max-width: 640px) {
  .site-header .site-logo {
    padding: 10px 0;
    font-size: 17px;
  }

  .site-search-sticky {
    margin-bottom: 6px;
  }

  .site-search-input {
    padding: 9px 10px;
    font-size: 13px;
  }

  .site-search-button {
    padding: 9px 12px;
    font-size: 14px;
    border-radius: 10px;
  }
}
.guest-submit-modal {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px 14px;
  box-sizing: border-box;
  overflow-y: auto;
  overscroll-behavior: contain;
}

.guest-submit-modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.35);
}

.guest-submit-modal-card {
  position: relative;
  z-index: 1;
  width: min(92vw, 520px);
  max-height: calc(100dvh - 32px);
  overflow-y: auto;
  margin: 0;
  padding: 24px;
  border-radius: 18px;
  background: #fffaf3;
  box-shadow: 0 18px 48px rgba(0, 0, 0, 0.22);
  box-sizing: border-box;
  -webkit-overflow-scrolling: touch;
}

body:has(.guest-submit-modal:not([hidden])) {
  overflow: hidden;
}

/* スマホ横スクロール防止（最小差分） */
html,
body {
  overflow-x: hidden;
}

/* 編集フォームのスマホはみ出し防止 */
.form-card,
.item-form,
.form-group,
.form-group input,
.form-group textarea,
.form-group select {
  max-width: 100%;
  min-width: 0;
}
.form-card {
  width: 100%;
}
@media (max-width: 640px) {
  .form-card {
    overflow: hidden;
  }

  .item-form,
  .form-row,
  .form-group {
    width: 100%;
    max-width: 100%;
    min-width: 0;
  }

  .form-group input,
  .form-group textarea,
  .form-group select {
    width: 100%;
    max-width: 100%;
    min-width: 0;
    box-sizing: border-box;
  }
}
/* 個体詳細ページ：読んでいる個体名をスマホでも崩さず表示 */
.item-title-sticky {
  position: sticky;
  top: 0;
  z-index: 900;
  margin: 0 0 14px;
  padding: 8px 14px;
  background: #fcfaf6;
  border: 1px solid #e3d7c5;
  border-radius: 12px;
  font-size: 15px;
  font-weight: 700;
  max-width: 100%;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.file-input {
  max-width: 100%;
  box-sizing: border-box;
}

.item-notes {
  margin: 0;
  line-height: 1.8;
  white-space: pre-line;
  overflow-wrap: anywhere;
  word-break: break-word;
}

.status-box a:hover {
  background: rgba(0, 0, 0, 0.03);
}

.status-box .hero-actions a.secondary-button:hover {
  background: #eee4d4;
}

.watch-card-frame-simple {
    border: 1px solid #d8c7ad;
}

.watch-card-frame-bronze {
    border: 1px solid #b5824b;
}

.watch-card-frame-brass {
    border: 1px solid #c7a24a;
}

.watch-card-frame-steel {
    border: 1px solid #9da3a6;
}

.watch-card-bg-craft {
    background: linear-gradient(135deg, #fff8ec 0%, #f2e4cf 100%);
}

.watch-card-bg-cream {
    background: #fffaf0;
}

.watch-card-bg-gray {
    background: #f3f3f1;
}

.watch-card-bg-navy {
    background: linear-gradient(135deg, #1f2a35 0%, #35465a 100%);
}

.watch-card-effect-glow {
    box-shadow: 0 10px 26px rgba(181, 130, 75, 0.28), 0 0 0 1px rgba(255, 255, 255, 0.35);
}

.thread-photo-preview {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  margin-top: 8px;
}

.thread-photo-preview-item {
  position: relative;
  border: 1px solid #d8cbb8;
  border-radius: 8px;
  overflow: hidden;
  background: #fff;
}

.thread-photo-preview-item img {
  display: block;
  width: 100%;
  aspect-ratio: 1 / 1;
  object-fit: cover;
}

.thread-photo-remove-button {
  width: 100%;
  border: none;
  padding: 6px;
  font-size: 12px;
  background: #f4eee6;
  cursor: pointer;
}

.form-help {
  margin: 6px 0 0;
  font-size: 13px;
  color: #777;
}

.thread-photo-list {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
}

.thread-photo-list img {
  width: 100%;
  aspect-ratio: 1 / 1;
  object-fit: cover;
  border-radius: 8px;
}

.thread-photo-zoom-button {
  display: block;
  width: 100%;
  padding: 0;
  border: none;
  background: transparent;
  cursor: zoom-in;
}

.thread-photo-zoom-button img {
  display: block;
}

.photo-modal {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 16px;
  background: rgba(0, 0, 0, 0.78);
}

.photo-modal.is-open {
  display: flex;
}

.photo-modal img {
  max-width: 100%;
  max-height: 88vh;
  border-radius: 10px;
  background: #fff;
}

.photo-modal-close {
  position: fixed;
  top: 12px;
  right: 12px;
  border: none;
  border-radius: 999px;
  padding: 8px 12px;
  font-size: 16px;
  background: #fff;
  cursor: pointer;
}

.thread-photo-viewer {
  display: grid;
  gap: 8px;
}

.thread-main-photo {
  display: block;
  width: 100%;
  max-height: 520px;
  object-fit: contain;
  border-radius: 10px;
  background: #f8f5ef;
}

.thread-photo-thumbs {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
}

.thread-photo-thumb {
  display: block;
  width: 100%;
  padding: 0;
  border: 1px solid #d8cbb8;
  border-radius: 8px;
  overflow: hidden;
  background: #fff;
  cursor: pointer;
}

.thread-photo-thumb img {
  display: block;
  width: 100%;
  aspect-ratio: 1 / 1;
  object-fit: cover;
}