:root {
  color-scheme: light;
  --bg: #f7f6f2;
  --surface: #ffffff;
  --surface-soft: #f0f4f2;
  --ink: #1d2422;
  --muted: #63706b;
  --line: #d9dfdb;
  --accent: #176b5b;
  --accent-strong: #0f5145;
  --accent-soft: #dceee9;
  --focus: #2f7dd1;
  --shadow: 0 18px 50px rgba(27, 35, 32, 0.08);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-width: 320px;
  background: var(--bg);
  color: var(--ink);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  line-height: 1.5;
}

button,
input {
  font: inherit;
}

button {
  cursor: pointer;
}

button:focus-visible,
input:focus-visible {
  outline: 3px solid rgba(47, 125, 209, 0.35);
  outline-offset: 2px;
}

.app-header {
  display: grid;
  grid-template-columns: minmax(0, 0.8fr) minmax(280px, 1.2fr);
  gap: 28px;
  align-items: end;
  width: min(1180px, calc(100% - 32px));
  margin: 0 auto;
  padding: 34px 0 22px;
}

.eyebrow {
  margin: 0 0 4px;
  color: var(--accent);
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0;
  text-transform: uppercase;
}

h1,
h2,
h3,
p {
  margin-top: 0;
}

h1 {
  margin-bottom: 0;
  font-size: clamp(2rem, 5vw, 4.3rem);
  line-height: 0.95;
  letter-spacing: 0;
}

h2 {
  margin-bottom: 4px;
  font-size: 1.1rem;
  letter-spacing: 0;
}

h3 {
  margin-bottom: 10px;
  color: var(--muted);
  font-size: 0.78rem;
  letter-spacing: 0;
  text-transform: uppercase;
}

.search-wrap {
  display: grid;
  gap: 8px;
}

.search-label {
  color: var(--muted);
  font-size: 0.88rem;
  font-weight: 650;
}

.search-input {
  width: 100%;
  min-height: 54px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  color: var(--ink);
  padding: 0 16px;
  box-shadow: var(--shadow);
}

.search-input::placeholder {
  color: #8a9691;
}

.app-shell {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(300px, 380px);
  gap: 24px;
  width: min(1180px, calc(100% - 32px));
  margin: 0 auto;
  padding-bottom: 36px;
}

.results-panel,
.detail-panel {
  min-width: 0;
}

.section-head {
  display: flex;
  gap: 16px;
  align-items: start;
  justify-content: space-between;
  margin-bottom: 14px;
}

.summary,
.detail-meta,
.empty-detail p,
.muted {
  color: var(--muted);
}

.summary {
  margin-bottom: 0;
  font-size: 0.92rem;
}

.ghost-button,
.primary-button,
.tag-chip,
.variant-chip,
.emoji-card {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  color: var(--ink);
}

.ghost-button {
  min-height: 38px;
  padding: 0 13px;
  color: var(--accent);
  font-weight: 700;
}

.active-filter {
  display: inline-flex;
  max-width: 100%;
  margin-bottom: 14px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--accent-soft);
  padding: 6px 12px;
  color: var(--accent-strong);
  font-size: 0.88rem;
  font-weight: 700;
}

.emoji-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(146px, 1fr));
  gap: 10px;
}

.emoji-card {
  display: grid;
  grid-template-rows: auto minmax(2.6em, auto) auto;
  gap: 6px;
  min-height: 156px;
  padding: 14px;
  text-align: left;
  transition: border-color 140ms ease, transform 140ms ease, box-shadow 140ms ease;
}

.emoji-card:hover,
.emoji-card[aria-pressed="true"] {
  border-color: rgba(23, 107, 91, 0.55);
  box-shadow: 0 12px 34px rgba(27, 35, 32, 0.11);
  transform: translateY(-1px);
}

.card-emoji {
  font-size: 2.15rem;
  line-height: 1;
}

.card-name {
  overflow-wrap: anywhere;
  font-weight: 760;
  line-height: 1.25;
}

.card-meta {
  color: var(--muted);
  font-size: 0.78rem;
}

.detail-panel {
  position: sticky;
  top: 16px;
  align-self: start;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  padding: 20px;
  box-shadow: var(--shadow);
}

.empty-detail {
  display: grid;
  justify-items: start;
  min-height: 260px;
  align-content: center;
}

.empty-emoji {
  margin-bottom: 14px;
  color: var(--accent);
  font-size: 3rem;
  line-height: 1;
}

.detail-main {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 16px;
  align-items: center;
}

.detail-emoji {
  display: grid;
  width: 78px;
  height: 78px;
  place-items: center;
  border-radius: 8px;
  background: var(--surface-soft);
  font-size: 3.25rem;
  line-height: 1;
}

.detail-main h2 {
  margin-bottom: 5px;
  overflow-wrap: anywhere;
  font-size: 1.35rem;
  line-height: 1.2;
}

.detail-meta {
  margin-bottom: 0;
  font-size: 0.9rem;
}

.copy-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
  margin: 18px 0 22px;
}

.primary-button {
  min-height: 42px;
  border-color: var(--accent);
  background: var(--accent);
  padding: 0 16px;
  color: #ffffff;
  font-weight: 800;
}

.primary-button:hover {
  background: var(--accent-strong);
}

.copy-status {
  min-height: 1.5em;
  color: var(--accent);
  font-size: 0.9rem;
  font-weight: 800;
}

.detail-section {
  border-top: 1px solid var(--line);
  padding-top: 16px;
}

.detail-section + .detail-section {
  margin-top: 16px;
}

.chip-list,
.variant-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.tag-chip {
  min-height: 34px;
  background: var(--surface-soft);
  padding: 0 11px;
  color: var(--accent-strong);
  font-size: 0.9rem;
  font-weight: 700;
}

.tag-chip:hover {
  border-color: var(--accent);
  background: var(--accent-soft);
}

.variant-chip {
  display: grid;
  width: 42px;
  height: 42px;
  place-items: center;
  background: var(--surface-soft);
  font-size: 1.45rem;
}

.empty-results {
  grid-column: 1 / -1;
  border: 1px dashed var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.55);
  padding: 24px;
  color: var(--muted);
}

[hidden] {
  display: none !important;
}

@media (max-width: 880px) {
  .app-header,
  .app-shell {
    grid-template-columns: 1fr;
  }

  .app-header {
    gap: 18px;
    padding-top: 24px;
  }

  .detail-panel {
    position: static;
    order: -1;
  }
}

@media (max-width: 520px) {
  .app-header,
  .app-shell {
    width: min(100% - 20px, 1180px);
  }

  .emoji-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
  }

  .emoji-card {
    min-height: 146px;
    padding: 12px;
  }

  .detail-panel {
    padding: 16px;
  }

  .detail-main {
    grid-template-columns: 1fr;
  }

  .detail-emoji {
    width: 66px;
    height: 66px;
    font-size: 2.75rem;
  }
}
