:root {
  font-family: 'Inter', 'Manrope', system-ui, -apple-system, BlinkMacSystemFont,
    'Segoe UI', sans-serif;
  color: #2f2f2f;
  background-color: #e2e2e2;
  line-height: 1.6;
  font-weight: 500;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

body {
  margin: 0;
  background-color: #e2e2e2;
  color: #2f2f2f;
}

a {
  color: inherit;
  text-decoration: none;
}

.layout {
  max-width: 1040px;
  margin: 56px auto 88px;
  padding: 0 20px;
  text-align: center;
}

.logo-emoji {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 48px;
  height: 48px;
  margin-bottom: 10px;
  font-size: 1.4rem;
  border-radius: 12px;
  background: #f4f4f4;
  border: 1px solid #d3d3d3;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.8);
}

.site-title {
  margin: 0;
  font-size: clamp(2rem, 4vw, 2.8rem);
  font-weight: 800;
  letter-spacing: -0.01em;
}

.beta {
  margin-left: 6px;
  font-weight: 600;
  color: #7d7d7d;
}

.intro {
  max-width: 640px;
  margin: 18px auto 28px;
  color: #3c3c3c;
  font-weight: 500;
}

.search {
  display: inline-flex;
  align-items: stretch;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 18px;
}

.search input {
  min-width: 240px;
  border: 1px solid #bbbbbb;
  border-radius: 4px;
  padding: 9px 12px;
  font-size: 0.95rem;
  color: #2f2f2f;
  background: linear-gradient(180deg, #fafafa 0%, #f3f3f3 100%);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.8);
}

.search button {
  border: 1px solid #8f8f8f;
  border-radius: 4px;
  padding: 9px 16px;
  font-size: 0.95rem;
  font-weight: 800;
  text-transform: lowercase;
  background: linear-gradient(180deg, #e2e2e2 0%, #d4d4d4 100%);
  color: #2a2a2a;
  cursor: pointer;
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.7);
  transition: border-color 120ms ease, transform 120ms ease,
    box-shadow 120ms ease;
}

.search button:hover,
.search button:focus-visible {
  border-color: #7a7a7a;
  transform: translateY(-1px);
  box-shadow: 0 6px 14px rgba(0, 0, 0, 0.08);
}

.search input:focus-visible {
  outline: none;
  border-color: #8f8f8f;
  box-shadow: 0 0 0 3px rgba(0, 0, 0, 0.08);
}

.tag-board {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  justify-content: center;
  margin-top: 12px;
}

.pill {
  display: inline-block;
  padding: 10px 14px;
  background: #f7f7f7;
  border: 1px solid #d1d1d1;
  border-radius: 6px;
  font-size: 0.95rem;
  color: #3a3a3a;
  font-weight: 700;
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.7);
  transition: border-color 120ms ease, box-shadow 120ms ease,
    transform 120ms ease;
}

.pill:hover,
.pill:focus-visible {
  border-color: #aaaaaa;
  box-shadow: 0 6px 12px rgba(0, 0, 0, 0.08);
  transform: translateY(-1px);
  outline: none;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

@media (max-width: 640px) {
  .layout {
    margin: 40px auto 64px;
  }

  .search {
    width: 100%;
    justify-content: center;
  }

  .search input {
    width: 100%;
    max-width: 360px;
  }
}

/* Detail page styles */
.detail-page {
  max-width: 1280px;
  margin: 0 auto 80px;
  padding: 18px 18px 60px;
}

.detail-top-bar {
  display: flex;
  gap: 8px;
  align-items: center;
  background: #d6d6d6;
  border: 1px solid #bfbfbf;
  border-radius: 6px;
  padding: 8px 10px;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.8);
}

.detail-top-bar input {
  flex: 1;
  border: 1px solid #b3b3b3;
  border-radius: 4px;
  padding: 9px 10px;
  font-size: 0.95rem;
  background: #f7f7f7;
}

.detail-top-bar button {
  border: 1px solid #8e8e8e;
  border-radius: 4px;
  padding: 9px 14px;
  font-weight: 700;
  background: linear-gradient(180deg, #f0f0f0 0%, #d9d9d9 100%);
  cursor: pointer;
}

.detail-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
  gap: 10px;
  margin-top: 16px;
}

.detail-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  background: #f7f7f7;
  border: 1px solid #c9c9c9;
  border-radius: 6px;
  padding: 14px 10px 10px;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.8);
  min-height: 110px;
}

.detail-emoji {
  font-size: 1.8rem;
  line-height: 1.2;
}

.detail-actions {
  display: flex;
  gap: 6px;
  width: 100%;
}

.detail-btn {
  flex: 1;
  border: 1px solid #b8b8b8;
  border-radius: 4px;
  padding: 6px 8px;
  font-size: 0.85rem;
  background: #ffffff;
  cursor: pointer;
}

.detail-btn-secondary {
  flex: 0;
  width: 32px;
  text-align: center;
}

.detail-more {
  margin: 30px auto 40px;
  display: inline-block;
  padding: 12px 20px;
  font-size: 1.1rem;
  font-weight: 700;
  border: 1px solid #a8a8a8;
  border-radius: 6px;
  background: #f6f6f6;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.8);
}

.detail-section-title {
  text-align: center;
  margin: 32px 0 16px;
  font-size: 1.4rem;
  font-weight: 700;
}

.detail-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: center;
  margin-bottom: 24px;
}

.detail-tag {
  padding: 6px 10px;
  background: #f5f5f5;
  border: 1px solid #cccccc;
  border-radius: 4px;
  font-size: 0.95rem;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.8);
}

.detail-add-form {
  max-width: 660px;
  margin: 30px auto 0;
  padding: 14px 14px 16px;
  border: 2px solid #a5a5a5;
  border-radius: 8px;
  background: #e6e6e6;
  display: flex;
  gap: 8px;
  align-items: center;
  flex-wrap: wrap;
}

.detail-add-form label {
  font-weight: 700;
}

.detail-add-form input[type='text'] {
  flex: 1;
  min-width: 220px;
  padding: 9px 10px;
  border: 1px solid #b3b3b3;
  border-radius: 4px;
  background: #f7f7f7;
}

.detail-add-form button {
  border: 1px solid #8e8e8e;
  border-radius: 4px;
  padding: 9px 12px;
  font-weight: 700;
  background: linear-gradient(180deg, #f0f0f0 0%, #d9d9d9 100%);
  cursor: pointer;
}

.detail-add-form .detail-icon-btn {
  padding: 9px 10px;
  width: 40px;
  text-align: center;
}

@media (max-width: 640px) {
  .detail-page {
    padding: 12px 12px 40px;
  }

  .detail-top-bar {
    flex-wrap: wrap;
  }

  .detail-top-bar button {
    width: 100%;
  }
}
