:root {
  --bg: #faf8f5;
  --bg-warm: #f5f0ea;
  --fg: #2a2520;
  --fg-soft: #6b6258;
  --fg-muted: #a89e92;
  --accent: #c47a5a;
  --accent-light: #e8c4a8;
  --border: #e8e0d6;
  --card: #ffffff;
  --shadow: 0 2px 12px rgba(42,37,32,0.06);
  --shadow-hover: 0 8px 28px rgba(42,37,32,0.10);
  --radius: 16px;
  --radius-sm: 10px;
  --font-display: "Playfair Display", Georgia, serif;
  --font-body: "Noto Sans", "Noto Sans JP", "Noto Sans Symbols 2", "Noto Sans Math", "Noto Music", "Noto Color Emoji", "Segoe UI Emoji", "Apple Color Emoji", "Segoe UI Symbol", "Hiragino Sans", sans-serif;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

html { font-size: 15px; }

body {
  font-family: var(--font-body);
  background: var(--bg);
  color: var(--fg);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

.page {
  display: flex;
  min-height: 100vh;
}

/* ── Sidebar ── */
.sidebar {
  width: 240px;
  background: var(--bg-warm);
  border-right: 1px solid var(--border);
  padding: 32px 20px;
  position: fixed;
  height: 100vh;
  overflow-y: auto;
  z-index: 10;
}

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

.brand h1 {
  font-family: var(--font-display);
  font-size: 1.5rem;
  font-weight: 600;
  color: var(--fg);
  letter-spacing: -0.02em;
}

.brand p {
  font-size: 0.75rem;
  color: var(--fg-muted);
  font-weight: 300;
}

.lang-toggle {
  position: absolute;
  top: 4px;
  right: 0;
  padding: 8px 16px;
  border-radius: var(--radius-sm);
  background: var(--card);
  border: 1px solid var(--border);
  font-size: 0.9rem;
  color: var(--fg-soft);
  cursor: pointer;
  transition: all 0.15s ease;
  font-family: var(--font-body);
  font-weight: 500;
}

.lang-toggle:hover {
  background: var(--accent);
  color: #fff;
  border-color: var(--accent);
}

.nav {
  margin-top: 28px;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.nav-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 7px 12px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  font-size: 0.82rem;
  color: var(--fg-soft);
  transition: all 0.15s ease;
  text-decoration: none;
}

.nav-item:hover {
  background: rgba(196,122,90,0.08);
  color: var(--accent);
}

.nav-item.active {
  background: rgba(196,122,90,0.12);
  color: var(--accent);
  font-weight: 500;
}

.nav-item .count {
  font-size: 0.7rem;
  color: var(--fg-muted);
  background: var(--bg);
  padding: 1px 7px;
  border-radius: 20px;
}

/* ── Main ── */
.main {
  flex: 1;
  margin-left: 240px;
  padding: 40px 48px;
  max-width: 1100px;
  position: relative;
}

.search-bar {
  position: relative;
  margin-bottom: 32px;
}

.search-bar input {
  width: 100%;
  padding: 14px 20px 14px 48px;
  font-size: 1rem;
  font-family: var(--font-body);
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  background: var(--card);
  color: var(--fg);
  outline: none;
  transition: all 0.2s ease;
  box-shadow: var(--shadow);
}

.search-bar input:focus {
  border-color: var(--accent-light);
  box-shadow: 0 0 0 4px rgba(196,122,90,0.08), var(--shadow);
}

.search-bar input::placeholder {
  color: var(--fg-muted);
  font-weight: 300;
}

.search-icon {
  position: absolute;
  left: 18px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 1.2rem;
  color: var(--fg-muted);
  pointer-events: none;
}

/* ── Hero ── */
.hero {
  text-align: center;
  padding: 20px 0 36px;
}

.hero h2 {
  font-family: var(--font-display);
  font-size: 2.2rem;
  font-weight: 400;
  color: var(--fg);
  margin-bottom: 8px;
}

.hero p {
  color: var(--fg-soft);
  font-size: 0.95rem;
  font-weight: 300;
}

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

.quick-tag {
  padding: 6px 16px;
  border-radius: 24px;
  background: var(--card);
  border: 1px solid var(--border);
  font-size: 0.8rem;
  color: var(--fg-soft);
  cursor: pointer;
  transition: all 0.15s ease;
  font-family: var(--font-body);
}

.quick-tag:hover {
  background: var(--accent);
  color: #fff;
  border-color: var(--accent);
  transform: translateY(-1px);
}

/* ── Results ── */
.results {
  display: flex;
  flex-direction: column;
  gap: 36px;
}

.result-group {
  animation: fadeIn 0.4s ease both;
}

.result-group h3 {
  font-family: var(--font-display);
  font-size: 1.15rem;
  font-weight: 600;
  color: var(--fg);
  margin-bottom: 4px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.result-group .desc {
  font-size: 0.8rem;
  color: var(--fg-muted);
  margin-bottom: 14px;
  font-weight: 300;
}

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

.symbol-card {
  aspect-ratio: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 1.6rem;
  font-family: "Noto Color Emoji", "Segoe UI Emoji", "Apple Color Emoji", "Noto Sans", "Noto Sans Symbols 2", "Noto Sans Math", "Noto Music", "Segoe UI Symbol", "Noto Sans JP", sans-serif;
  cursor: pointer;
  transition: all 0.15s ease;
  position: relative;
  overflow: hidden;
  user-select: none;
  box-shadow: var(--shadow);
}

.symbol-card:hover {
  transform: translateY(-3px) scale(1.05);
  box-shadow: var(--shadow-hover);
  border-color: var(--accent-light);
  z-index: 2;
}

.symbol-card:active {
  transform: translateY(0) scale(0.98);
}

.symbol-card .copy-hint {
  position: absolute;
  bottom: 4px;
  left: 50%;
  transform: translateX(-50%);
  font-size: 0.55rem;
  color: var(--fg-muted);
  opacity: 0;
  transition: opacity 0.15s ease;
  white-space: nowrap;
}

.symbol-card:hover .copy-hint {
  opacity: 1;
}

.symbol-card.copied {
  border-color: #66bb6a;
  background: rgba(102, 187, 106, 0.08);
}

.symbol-card.copied .copy-hint {
  color: #43a047;
  font-weight: 600;
  opacity: 1;
}

.symbol-card.kaomoji {
  font-size: 1.1rem;
  grid-column: span 2;
  aspect-ratio: auto;
  padding: 14px 0;
}

.symbol-card.combo {
  grid-column: span 2;
  aspect-ratio: auto;
  padding: 14px 0;
  font-size: 1.2rem;
}

/* ── Empty ── */
.empty {
  text-align: center;
  padding: 60px 20px;
  color: var(--fg-muted);
}

.empty-icon {
  font-size: 3rem;
  margin-bottom: 12px;
  opacity: 0.4;
}

/* ── Toast ── */
.toast {
  position: fixed;
  bottom: 32px;
  left: 50%;
  transform: translateX(-50%) translateY(20px);
  background: var(--fg);
  color: #fff;
  padding: 10px 24px;
  border-radius: 30px;
  font-size: 0.85rem;
  font-weight: 500;
  opacity: 0;
  pointer-events: none;
  transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
  z-index: 100;
}

.toast.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

/* ── Animations ── */
@keyframes fadeIn {
  from { opacity: 0; transform: translateY(12px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ── Responsive ── */
@media (max-width: 860px) {
  .sidebar {
    width: 100%;
    height: auto;
    position: relative;
    border-right: none;
    border-bottom: 1px solid var(--border);
    padding: 20px;
  }
  .nav {
    flex-direction: row;
    flex-wrap: wrap;
    margin-top: 16px;
  }
  .nav-item {
    padding: 5px 10px;
    font-size: 0.78rem;
  }
  .main {
    margin-left: 0;
    padding: 24px 20px;
    max-width: 100%;
  }
  .page { flex-direction: column; }
  .hero h2 { font-size: 1.6rem; }
  .symbol-grid {
    grid-template-columns: repeat(auto-fill, minmax(56px, 1fr));
    gap: 8px;
  }
}
