/* ═══════════════════════════════════════════
   Emojive — Main Stylesheet
   ═══════════════════════════════════════════ */

/* ─── CSS Variables ─── */
:root {
    --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    --font-mono: 'JetBrains Mono', monospace;

    /* Light theme */
    --bg-primary: #ffffff;
    --bg-secondary: #f8f9fb;
    --bg-tertiary: #f0f2f5;
    --bg-hover: #eef0f4;
    --text-primary: #1a1d23;
    --text-secondary: #5f6570;
    --text-tertiary: #9ca3af;
    --border: #e5e7eb;
    --border-light: #f0f2f5;
    --accent: #6366f1;
    --accent-hover: #4f46e5;
    --accent-light: #eef2ff;
    --logo-gradient: linear-gradient(135deg, #6366f1, #c026d3);
    --success: #10b981;
    --success-light: #ecfdf5;
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, .05);
    --shadow-md: 0 4px 12px rgba(0, 0, 0, .08);
    --shadow-lg: 0 8px 24px rgba(0, 0, 0, .12);
    --radius-sm: 6px;
    --radius-md: 10px;
    --radius-lg: 14px;
    --radius-full: 999px;
    --container: 1100px;
    --header-h: 64px;
}

[data-theme="dark"] {
    --bg-primary: #0f1117;
    --bg-secondary: #1a1d27;
    --bg-tertiary: #252830;
    --bg-hover: #2a2d38;
    --text-primary: #f0f1f3;
    --text-secondary: #9ca3b0;
    --text-tertiary: #636a78;
    --border: #2a2d38;
    --border-light: #1f2230;
    --accent: #818cf8;
    --accent-hover: #6366f1;
    --accent-light: #1e1b4b;
    --logo-gradient: linear-gradient(135deg, #a78bfa, #f472b6);
    --success: #34d399;
    --success-light: #064e3b;
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, .2);
    --shadow-md: 0 4px 12px rgba(0, 0, 0, .3);
    --shadow-lg: 0 8px 24px rgba(0, 0, 0, .4);
}

/* ─── Reset ─── */
*,
*::before,
*::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    scroll-behavior: smooth;
    -webkit-text-size-adjust: 100%;
}

body {
    font-family: var(--font-sans);
    background: var(--bg-secondary);
    color: var(--text-primary);
    line-height: 1.6;
    min-height: 100vh;
    -webkit-font-smoothing: antialiased;
}

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

button {
    cursor: pointer;
    border: none;
    background: none;
    font: inherit;
    color: inherit;
}

ul,
ol {
    list-style: none;
}

img {
    max-width: 100%;
    display: block;
}

/* ─── Container ─── */
.container {
    max-width: var(--container);
    margin: 0 auto;
    padding: 0 20px;
}

/* ─── Header ─── */
.header {
    position: sticky;
    top: 0;
    z-index: 100;
    background: var(--bg-primary);
    border-bottom: 1px solid var(--border);
    backdrop-filter: blur(12px);
    height: var(--header-h);
}

.header-inner {
    display: flex;
    align-items: center;
    gap: 16px;
    height: var(--header-h);
}

.logo {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-shrink: 0;
    text-decoration: none;
}

.logo-text {
    font-weight: 800;
    font-size: 24px;
    letter-spacing: -0.5px;
    background: var(--logo-gradient);
    -webkit-background-clip: text;
    color: transparent;
    display: inline-block;
}

/* ─── Search ─── */
.search-wrapper {
    flex: 1;
    max-width: 420px;
    position: relative;
}

.search-box {
    display: flex;
    align-items: center;
    gap: 8px;
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: var(--radius-full);
    padding: 8px 16px;
    transition: border-color .2s, box-shadow .2s;
}

.search-box:focus-within {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px var(--accent-light);
}

.search-icon {
    color: var(--text-tertiary);
    flex-shrink: 0;
}

.search-input {
    flex: 1;
    border: none;
    background: none;
    outline: none;
    font-size: 14px;
    color: var(--text-primary);
}

.search-input::placeholder {
    color: var(--text-tertiary);
}

.search-kbd {
    font-family: var(--font-mono);
    font-size: 11px;
    padding: 2px 6px;
    border-radius: 4px;
    background: var(--bg-tertiary);
    border: 1px solid var(--border);
    color: var(--text-tertiary);
    line-height: 1;
}

.search-results {
    position: absolute;
    top: calc(100% + 8px);
    left: 0;
    right: 0;
    background: var(--bg-primary);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-lg);
    max-height: 400px;
    overflow-y: auto;
    z-index: 200;
}

.search-result-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 16px;
    transition: background .15s;
    cursor: pointer;
}

.search-result-item:hover,
.search-result-item.active {
    background: var(--bg-hover);
}

.search-result-item .sr-emoji {
    font-size: 28px;
    width: 40px;
    text-align: center;
}

.search-result-item .sr-info {
    flex: 1;
}

.search-result-item .sr-name {
    font-size: 14px;
    font-weight: 500;
}

.search-result-item .sr-cat {
    font-size: 12px;
    color: var(--text-tertiary);
}

.search-no-results {
    padding: 20px;
    text-align: center;
    color: var(--text-tertiary);
    font-size: 14px;
}

/* ─── Navigation ─── */
.nav {
    display: flex;
    align-items: center;
    gap: 4px;
    flex-shrink: 0;
    margin-left: auto;
}

.nav-link,
.nav-btn {
    font-size: 14px;
    font-weight: 500;
    padding: 8px 12px;
    border-radius: var(--radius-sm);
    color: var(--text-secondary);
    transition: color .15s, background .15s;
}

.nav-link:hover,
.nav-btn:hover {
    color: var(--text-primary);
    background: var(--bg-hover);
}

.nav-btn {
    display: flex;
    align-items: center;
    gap: 4px;
}

.nav-dropdown {
    position: relative;
}

.dropdown-menu {
    position: absolute;
    top: calc(100% + 4px);
    right: 0;
    background: var(--bg-primary);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-lg);
    min-width: 220px;
    padding: 6px;
    z-index: 200;
}

.dropdown-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 12px;
    border-radius: var(--radius-sm);
    font-size: 14px;
    transition: background .15s;
}

.dropdown-item:hover {
    background: var(--bg-hover);
}

.dropdown-icon {
    font-size: 18px;
    width: 24px;
    text-align: center;
}

/* Theme toggle */
.theme-toggle {
    padding: 8px;
    border-radius: var(--radius-sm);
    transition: background .15s;
}

.theme-toggle:hover {
    background: var(--bg-hover);
}

[data-theme="light"] .icon-moon {
    display: none;
}

[data-theme="dark"] .icon-sun {
    display: none;
}

.mobile-menu-toggle {
    display: none;
    padding: 8px;
}

/* ─── Toast ─── */
.toast {
    position: fixed;
    bottom: 24px;
    left: 50%;
    transform: translateX(-50%) translateY(20px);
    background: var(--text-primary);
    color: var(--bg-primary);
    padding: 10px 20px;
    border-radius: var(--radius-full);
    font-size: 14px;
    font-weight: 500;
    opacity: 0;
    pointer-events: none;
    transition: opacity .25s, transform .25s;
    z-index: 9999;
    box-shadow: var(--shadow-lg);
}

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

/* ─── Breadcrumb ─── */
.breadcrumb {
    margin-bottom: 20px;
}

.breadcrumb ol {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 4px;
}

.breadcrumb-item {
    font-size: 13px;
    color: var(--text-tertiary);
}

.breadcrumb-item a {
    color: var(--text-secondary);
    transition: color .15s;
}

.breadcrumb-item a:hover {
    color: var(--accent);
}

.breadcrumb-item:not(:last-child)::after {
    content: '›';
    margin-left: 4px;
    color: var(--text-tertiary);
}

.breadcrumb-item.active {
    color: var(--text-secondary);
}

/* ─── Main ─── */
.main {
    padding: 32px 0 60px;
    min-height: calc(100vh - var(--header-h) - 200px);
}

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

.hero-title {
    font-size: 40px;
    font-weight: 700;
    letter-spacing: -0.02em;
    margin-bottom: 12px;
    background: linear-gradient(135deg, var(--accent), #ec4899);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.hero-subtitle {
    font-size: 17px;
    color: var(--text-secondary);
    margin-bottom: 28px;
    max-width: 500px;
    margin-inline: auto;
}

.hero .search-wrapper {
    max-width: 520px;
    margin: 0 auto;
}

.hero .search-box {
    padding: 12px 20px;
    font-size: 16px;
}

.hero .search-input {
    font-size: 16px;
}

/* ─── Section ─── */
.section {
    margin-bottom: 48px;
}

.section-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 16px;
}

.section-title {
    font-size: 18px;
    font-weight: 600;
}

.section-link {
    font-size: 14px;
    color: var(--accent);
    font-weight: 500;
}

.section-link:hover {
    text-decoration: underline;
}

/* ─── Emoji Grid ─── */
.emoji-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(80px, 1fr));
    gap: 8px;
}

.emoji-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    padding: 12px 4px;
    background: var(--bg-primary);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: border-color .15s, box-shadow .15s;
    text-align: center;
}

.emoji-card:hover {
    border-color: var(--accent);
    box-shadow: var(--shadow-sm);
    z-index: 1;
}

.emoji-card .ec-char {
    font-size: 32px;
    line-height: 1;
}

.emoji-card .ec-name {
    font-size: 10px;
    color: var(--text-tertiary);
    line-height: 1.3;
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.emoji-card.copied {
    border-color: var(--success);
}

.emoji-card.copied .ec-name {
    color: var(--success);
}

/* Copy animation */
.copy-ripple {
    position: absolute;
    width: 0;
    height: 0;
    border-radius: 50%;
    background: var(--accent);
    opacity: 0.2;
    transform: translate(-50%, -50%);
    animation: copy-ripple-anim .6s ease-out forwards;
    pointer-events: none;
    z-index: 1;
}

@keyframes copy-ripple-anim {
    to {
        width: 200px;
        height: 200px;
        opacity: 0;
    }
}

.copy-check {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    font-weight: 700;
    color: var(--success);
    background: rgba(255, 255, 255, .85);
    animation: copy-check-anim .5s ease forwards;
    pointer-events: none;
    z-index: 2;
    border-radius: var(--radius-md);
}

[data-theme="dark"] .copy-check {
    background: rgba(15, 17, 23, .85);
}

@keyframes copy-check-anim {
    0% {
        opacity: 0;
        transform: scale(0.5);
    }

    30% {
        opacity: 1;
        transform: scale(1.1);
    }

    100% {
        opacity: 1;
        transform: scale(1);
    }
}

/* Lazy load hidden */
.lazy-hidden {
    display: none;
}

/* Grid size variants */
.emoji-grid.grid-lg {
    grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
}

.emoji-grid.grid-sm {
    grid-template-columns: repeat(auto-fill, minmax(64px, 1fr));
}

/* ─── Category Grid ─── */
.category-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 12px;
}

.category-card {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 16px 18px;
    background: var(--bg-primary);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-md);
    transition: border-color .15s, box-shadow .15s;
}

.category-card:hover {
    border-color: var(--accent);
    box-shadow: var(--shadow-sm);
}

.category-card .cc-icon {
    font-size: 32px;
}

.category-card .cc-info {
    flex: 1;
}

.category-card .cc-name {
    font-size: 15px;
    font-weight: 500;
}

.category-card .cc-count {
    font-size: 12px;
    color: var(--text-tertiary);
}

/* ─── Badge / Pill ─── */
.badge {
    display: inline-flex;
    align-items: center;
    font-size: 12px;
    padding: 3px 10px;
    border-radius: var(--radius-full);
    border: 1px solid var(--border);
    color: var(--text-secondary);
    background: var(--bg-secondary);
}

.badge-new {
    background: #fef3c7;
    color: #92400e;
    border-color: #fde68a;
}

[data-theme="dark"] .badge-new {
    background: #451a03;
    color: #fbbf24;
    border-color: #78350f;
}

/* Subcategory pills */
.pills {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 20px;
}

.pill {
    font-size: 13px;
    padding: 6px 14px;
    border-radius: var(--radius-full);
    border: 1px solid var(--border);
    color: var(--text-secondary);
    background: var(--bg-primary);
    transition: all .15s;
    cursor: pointer;
    text-decoration: none;
    display: inline-block;
}

.pill:hover,
.pill.active {
    background: var(--accent);
    color: #fff;
    border-color: var(--accent);
}

/* ─── Detail Page ─── */
.detail-hero {
    display: flex;
    align-items: flex-start;
    gap: 24px;
    margin-bottom: 32px;
}

.detail-emoji {
    font-size: 80px;
    line-height: 1;
    flex-shrink: 0;
}

.detail-info {
    flex: 1;
}

.detail-info h1 {
    font-size: 26px;
    font-weight: 600;
    margin-bottom: 8px;
}

.detail-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 16px;
}

.copy-main-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-size: 15px;
    font-weight: 500;
    padding: 10px 24px;
    background: var(--accent);
    color: #fff;
    border-radius: var(--radius-md);
    transition: background .15s;
}

.copy-main-btn:hover {
    background: var(--accent-hover);
}

.copy-main-btn.copied {
    background: var(--success);
}

.detail-section {
    margin-bottom: 28px;
}

.detail-section-title {
    font-size: 13px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--text-tertiary);
    margin-bottom: 12px;
}

/* Copy options */
.copy-grid {
    display: grid;
    gap: 6px;
}

.copy-row {
    display: flex;
    align-items: center;
    padding: 10px 14px;
    background: var(--bg-primary);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-sm);
}

.copy-row .cr-label {
    font-size: 12px;
    color: var(--text-tertiary);
    width: 90px;
    flex-shrink: 0;
}

.copy-row .cr-value {
    flex: 1;
    font-size: 14px;
    font-family: var(--font-mono);
}

.copy-row .cr-btn {
    font-size: 12px;
    padding: 4px 12px;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border);
    transition: all .15s;
}

.copy-row .cr-btn:hover {
    background: var(--bg-hover);
}

.copy-row .cr-btn.copied {
    color: var(--success);
    border-color: var(--success);
}

/* Meaning text */
.meaning-text {
    font-size: 15px;
    line-height: 1.8;
    color: var(--text-primary);
}

/* How to type */
.howto-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
}

.howto-item {
    padding: 12px 16px;
    background: var(--bg-primary);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-sm);
}

.howto-item .hi-os {
    font-size: 12px;
    font-weight: 600;
    color: var(--text-tertiary);
    margin-bottom: 2px;
}

.howto-item .hi-keys {
    font-size: 13px;
    font-family: var(--font-mono);
}

/* Skin tone variants */
.skin-tones {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.skin-tone-btn {
    display: inline-block;
    font-size: 32px;
    padding: 8px;
    line-height: 1;
    border: 1px solid var(--border-light);
    border-radius: var(--radius-sm);
    transition: all .15s;
    cursor: pointer;
    text-decoration: none;
}

.skin-tone-btn:hover {
    border-color: var(--accent);
}

.skin-tone-btn.active {
    border-color: var(--accent);
    background: var(--bg-secondary);
}

.skin-tone-btn.copied {
    border-color: var(--success);
}

/* Combos */
.combo-list {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.combo-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 14px;
    background: var(--bg-primary);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-lg);
    cursor: pointer;
    transition: border-color .15s;
}

.combo-item:hover {
    border-color: var(--accent);
}

.combo-item .ci-emojis {
    font-size: 20px;
}

.combo-item .ci-desc {
    font-size: 12px;
    color: var(--text-secondary);
}

.combos-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 8px;
}

.combo-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    padding: 16px 14px;
    background: var(--bg-primary);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: all .15s;
    text-align: center;
    position: relative;
    overflow: hidden;
}

.combo-card:hover {
    border-color: var(--accent);
    box-shadow: var(--shadow-sm);
}

.combo-card.copied {
    border-color: var(--success);
}

.combo-emojis {
    font-size: 28px;
    line-height: 1.2;
}

.combo-label {
    font-size: 12px;
    color: var(--text-secondary);
    font-weight: 500;
}

/* Tech details */
.tech-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
}

.tech-item {
    padding: 10px 14px;
    background: var(--bg-secondary);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-sm);
}

.tech-item .ti-label {
    font-size: 11px;
    color: var(--text-tertiary);
    margin-bottom: 2px;
}

.tech-item .ti-value {
    font-size: 13px;
    font-family: var(--font-mono);
}

/* FAQ */
.faq-list {
    display: grid;
    gap: 8px;
}

.faq-item {
    padding: 14px 16px;
    background: var(--bg-primary);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-sm);
}

.faq-item .fq-q {
    font-size: 14px;
    font-weight: 500;
    margin-bottom: 6px;
}

.faq-item .fq-a {
    font-size: 14px;
    color: var(--text-secondary);
    line-height: 1.6;
}

/* Also Known As */
.aka-list {
    display: grid;
    gap: 4px;
}

.aka-item {
    font-size: 14px;
    line-height: 1.6;
    color: var(--text-primary);
    padding: 6px 12px;
    background: var(--bg-primary);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-sm);
}

/* Word Associations / Tags */
.tags-cloud {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.tag-link {
    display: inline-flex;
    align-items: center;
    font-size: 13px;
    padding: 5px 14px;
    border-radius: var(--radius-full);
    border: 1px solid var(--border);
    color: var(--text-secondary);
    background: var(--bg-primary);
    transition: all .15s;
    text-decoration: none;
}

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

/* Platform Images */
.platform-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
    gap: 12px;
}

.platform-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    padding: 20px 12px;
    background: var(--bg-primary);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-md);
    transition: border-color .15s, box-shadow .15s;
    text-align: center;
}

.platform-card:hover {
    border-color: var(--accent);
    box-shadow: var(--shadow-sm);
}

.platform-img {
    width: 72px;
    height: 72px;
    object-fit: contain;
    image-rendering: -webkit-optimize-contrast;
}

.platform-emoji-native {
    font-size: 56px;
    line-height: 1;
    width: 72px;
    height: 72px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.platform-name {
    font-size: 12px;
    font-weight: 500;
    color: var(--text-tertiary);
}

/* Chat Examples */
.chat-container {
    display: flex;
    flex-direction: column;
    gap: 8px;
    max-width: 480px;
    padding: 20px;
    background: var(--bg-primary);
    border-radius: var(--radius-md);
    border: 1px solid var(--border-light);
}

.chat-bubble {
    max-width: 80%;
    padding: 10px 14px;
    border-radius: 18px;
    font-size: 14px;
    line-height: 1.5;
    word-wrap: break-word;
}

.chat-left {
    align-self: flex-start;
    background: var(--bg-secondary);
    color: var(--text-primary);
    border-bottom-left-radius: 4px;
}

.chat-right {
    align-self: flex-end;
    background: var(--accent);
    color: #fff;
    border-bottom-right-radius: 4px;
}

/* ─── Collection Grid ─── */
.collection-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 12px;
}

.collection-card {
    padding: 18px;
    background: var(--bg-primary);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-md);
    transition: all .15s;
}

.collection-card:hover {
    border-color: var(--accent);
    box-shadow: var(--shadow-sm);
}

.collection-card .clc-icon {
    font-size: 28px;
    margin-bottom: 8px;
}

.collection-card .clc-title {
    font-size: 15px;
    font-weight: 500;
    margin-bottom: 4px;
}

.collection-card .clc-count {
    font-size: 12px;
    color: var(--text-tertiary);
}

/* ─── Footer ─── */
.footer {
    background: var(--bg-primary);
    border-top: 1px solid var(--border);
    padding: 48px 0 24px;
}

.footer-grid {
    display: grid;
    grid-template-columns: 1.5fr 1fr 1fr 1fr;
    gap: 32px;
    margin-bottom: 32px;
}

.footer-brand .logo {
    margin-bottom: 12px;
}

.footer-desc {
    font-size: 14px;
    color: var(--text-secondary);
    line-height: 1.6;
}

.footer-heading {
    font-size: 13px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-tertiary);
    margin-bottom: 12px;
}

.footer-links li {
    margin-bottom: 8px;
}

.footer-links a {
    font-size: 14px;
    color: var(--text-secondary);
    transition: color .15s;
}

.footer-links a:hover {
    color: var(--accent);
}

.footer-bottom {
    border-top: 1px solid var(--border);
    padding-top: 20px;
}

.footer-bottom p {
    font-size: 13px;
    color: var(--text-tertiary);
    text-align: center;
}

/* ─── Page Header ─── */
.page-header {
    margin-bottom: 28px;
}

.page-title {
    font-size: 24px;
    font-weight: 600;
    margin-bottom: 8px;
}

.page-desc {
    font-size: 15px;
    color: var(--text-secondary);
    line-height: 1.6;
}

/* ─── Kaomoji ─── */
.kaomoji-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 8px;
}

.kaomoji-grid-lg {
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
}

.kaomoji-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 16px 12px;
    background: var(--bg-primary);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: border-color .15s, box-shadow .15s;
    text-align: center;
    min-height: 64px;
}

.kaomoji-card:hover {
    border-color: var(--accent);
    box-shadow: var(--shadow-sm);
    z-index: 1;
}

.kaomoji-card.copied {
    border-color: var(--success);
}

.kc-text {
    font-size: 18px;
    line-height: 1.4;
    white-space: nowrap;
}

.kc-tags {
    display: flex;
    gap: 4px;
    flex-wrap: wrap;
    justify-content: center;
}

.kc-tag {
    font-size: 10px;
    color: var(--text-tertiary);
    background: var(--bg-tertiary);
    padding: 1px 6px;
    border-radius: var(--radius-full);
}

/* ─── Search Page ─── */
.search-box-lg {
    padding: 12px 20px;
}

.search-box-lg .search-input {
    font-size: 16px;
}

.search-submit-btn {
    padding: 6px 16px;
    font-size: 14px;
    font-weight: 500;
    background: var(--accent);
    color: #fff;
    border: none;
    border-radius: var(--radius-full);
    cursor: pointer;
    transition: background .15s;
    flex-shrink: 0;
}

.search-submit-btn:hover {
    background: var(--accent-hover);
}

.empty-state {
    text-align: center;
    padding: 60px 20px;
}

.empty-icon {
    font-size: 56px;
    margin-bottom: 16px;
}

.empty-title {
    font-size: 20px;
    font-weight: 600;
    margin-bottom: 8px;
}

.empty-desc {
    font-size: 15px;
    color: var(--text-secondary);
}

.empty-suggestions .pills {
    justify-content: center;
}

/* ─── Emoji Text Editor ─── */
.editor-container {
    display: grid;
    gap: 20px;
}

.editor-main {
    background: var(--bg-primary);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    overflow: hidden;
}

.editor-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 16px;
    border-bottom: 1px solid var(--border-light);
    background: var(--bg-secondary);
}

.editor-char-count {
    font-size: 12px;
    color: var(--text-tertiary);
}

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

.editor-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 13px;
    font-weight: 500;
    padding: 6px 14px;
    background: var(--accent);
    color: #fff;
    border-radius: var(--radius-sm);
    transition: background .15s;
    cursor: pointer;
    border: none;
}

.editor-btn:hover {
    background: var(--accent-hover);
}

.editor-btn-ghost {
    background: transparent;
    color: var(--text-secondary);
    border: 1px solid var(--border);
}

.editor-btn-ghost:hover {
    background: var(--bg-hover);
    color: var(--text-primary);
}

.text-editor-area {
    min-height: 200px;
    padding: 20px;
    font-size: 16px;
    line-height: 1.8;
    outline: none;
    word-wrap: break-word;
    color: var(--text-primary);
}

.text-editor-area:empty:not(.focused)::before {
    content: attr(data-placeholder);
    color: var(--text-tertiary);
    pointer-events: none;
}

.editor-picker {
    background: var(--bg-primary);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    overflow: hidden;
}

.picker-tabs {
    display: flex;
    gap: 2px;
    padding: 8px;
    border-bottom: 1px solid var(--border-light);
    overflow-x: auto;
}

.picker-tab {
    padding: 6px 12px;
    font-size: 18px;
    border-radius: var(--radius-sm);
    transition: background .15s;
    cursor: pointer;
    border: none;
    background: none;
    flex-shrink: 0;
}

.picker-tab:hover {
    background: var(--bg-hover);
}

.picker-tab.active {
    background: var(--accent-light);
}

.picker-grid-wrapper {
    max-height: 260px;
    overflow-y: auto;
}

.picker-grid {
    display: none;
    padding: 8px;
    grid-template-columns: repeat(auto-fill, minmax(40px, 1fr));
    gap: 2px;
}

.picker-grid.active {
    display: grid;
}

.picker-emoji {
    font-size: 24px;
    padding: 6px;
    text-align: center;
    border: none;
    background: none;
    cursor: pointer;
    border-radius: var(--radius-sm);
    transition: background .15s, transform .1s;
    line-height: 1;
}

.picker-emoji:hover {
    background: var(--bg-hover);
}

/* ─── How to Type Guide ─── */
.howto-guide {
    display: grid;
    gap: 16px;
}

.guide-card {
    background: var(--bg-primary);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-lg);
    overflow: hidden;
}

.guide-header {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 16px 20px;
    background: var(--bg-secondary);
    border-bottom: 1px solid var(--border-light);
}

.guide-icon {
    font-size: 28px;
}

.guide-title {
    font-size: 18px;
    font-weight: 600;
}

.guide-body {
    padding: 20px;
}

.guide-shortcut {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 10px 16px;
    margin-bottom: 16px;
    background: var(--bg-tertiary);
    border-radius: var(--radius-md);
    font-family: var(--font-mono);
    font-size: 15px;
    font-weight: 500;
}

.guide-shortcut kbd {
    display: inline-block;
    padding: 3px 8px;
    background: var(--bg-primary);
    border: 1px solid var(--border);
    border-radius: 4px;
    font-family: var(--font-mono);
    font-size: 13px;
    box-shadow: 0 1px 0 var(--border);
}

.guide-steps {
    padding-left: 20px;
    list-style: decimal;
}

.guide-steps li {
    font-size: 14px;
    line-height: 1.8;
    color: var(--text-primary);
    margin-bottom: 4px;
}

.guide-tip {
    font-size: 13px;
    color: var(--text-secondary);
    margin-top: 12px;
    padding: 10px 14px;
    background: var(--bg-secondary);
    border-radius: var(--radius-sm);
}

.guide-tip code {
    font-family: var(--font-mono);
    font-size: 12px;
    background: var(--bg-tertiary);
    padding: 1px 4px;
    border-radius: 3px;
}

.howto-table-wrapper {
    overflow-x: auto;
}

.howto-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
}

.howto-table th,
.howto-table td {
    padding: 12px 16px;
    text-align: left;
    border-bottom: 1px solid var(--border-light);
}

.howto-table th {
    font-weight: 600;
    font-size: 13px;
    text-transform: uppercase;
    letter-spacing: .04em;
    color: var(--text-tertiary);
    background: var(--bg-secondary);
}

.howto-table td kbd {
    display: inline-block;
    padding: 2px 6px;
    background: var(--bg-tertiary);
    border: 1px solid var(--border);
    border-radius: 3px;
    font-family: var(--font-mono);
    font-size: 12px;
    box-shadow: 0 1px 0 var(--border);
}

/* ─── Static Pages ─── */
.static-page {
    max-width: 720px;
}

.static-content {
    font-size: 15px;
    line-height: 1.8;
    color: var(--text-primary);
}

.static-content h2 {
    font-size: 20px;
    font-weight: 600;
    margin: 28px 0 12px;
}

.static-content h3 {
    font-size: 16px;
    font-weight: 600;
    margin: 20px 0 8px;
}

.static-content p {
    margin-bottom: 12px;
}

.static-content ul,
.static-content ol {
    padding-left: 20px;
    margin-bottom: 12px;
}

.static-content li {
    margin-bottom: 6px;
    list-style: disc;
}

.static-content ol li {
    list-style: decimal;
}

.static-content code {
    font-family: var(--font-mono);
    font-size: 13px;
    background: var(--bg-tertiary);
    padding: 1px 4px;
    border-radius: 3px;
}

/* SEO text block */
.seo-text .meaning-text p {
    color: var(--text-secondary);
}

/* ─── Mobile Drawer ─── */
.mobile-drawer {
    position: fixed;
    top: 0;
    right: 0;
    bottom: 0;
    width: 280px;
    max-width: 80vw;
    background: var(--bg-primary);
    box-shadow: var(--shadow-lg);
    z-index: 1000;
    transform: translateX(100%);
    transition: transform .3s ease;
    overflow-y: auto;
    padding: 20px;
}

.mobile-drawer.open {
    transform: translateX(0);
}

.mobile-drawer-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, .4);
    z-index: 999;
    opacity: 0;
    pointer-events: none;
    transition: opacity .3s;
}

.mobile-drawer-overlay.open {
    opacity: 1;
    pointer-events: auto;
}

.drawer-close {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border-radius: var(--radius-sm);
    margin-left: auto;
    margin-bottom: 16px;
    transition: background .15s;
}

.drawer-close:hover {
    background: var(--bg-hover);
}

.drawer-nav {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.drawer-link {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    font-size: 15px;
    font-weight: 500;
    border-radius: var(--radius-sm);
    color: var(--text-primary);
    transition: background .15s;
}

.drawer-link:hover {
    background: var(--bg-hover);
}

.drawer-divider {
    height: 1px;
    background: var(--border);
    margin: 12px 0;
}

/* ─── Responsive ─── */
@media (max-width: 768px) {
    .hero-title {
        font-size: 28px;
    }

    .hero {
        padding: 32px 0 24px;
    }

    .nav-link,
    .nav-dropdown {
        display: none;
    }

    .mobile-menu-toggle {
        display: block;
    }

    .detail-hero {
        flex-direction: column;
        gap: 16px;
    }

    .detail-emoji {
        font-size: 60px;
    }

    .howto-grid,
    .tech-grid {
        grid-template-columns: 1fr;
    }

    .footer-grid {
        grid-template-columns: 1fr 1fr;
        gap: 24px;
    }

    .category-grid {
        grid-template-columns: 1fr 1fr;
    }

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

    .search-kbd {
        display: none;
    }

    .kaomoji-grid {
        grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    }

    .editor-toolbar {
        flex-direction: column;
        gap: 8px;
        align-items: flex-start;
    }
}

@media (max-width: 480px) {
    .footer-grid {
        grid-template-columns: 1fr;
    }

    .category-grid {
        grid-template-columns: 1fr;
    }

    .copy-row .cr-label {
        width: 70px;
    }

    .kaomoji-grid {
        grid-template-columns: 1fr 1fr;
    }

    .guide-shortcut {
        font-size: 13px;
    }
}

/* ─── Text Editor Page ─── */
.te-layout {
    display: grid;
    grid-template-columns: 1fr 340px;
    gap: 20px;
    align-items: start;
}

.te-card {
    background: var(--bg-primary);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-md);
    padding: 20px;
    margin-bottom: 16px;
}

.te-section-title {
    font-size: 15px;
    font-weight: 600;
    margin-bottom: 4px;
}

.te-section-desc {
    font-size: 13px;
    color: var(--text-tertiary);
    margin-bottom: 16px;
}

.te-section-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 12px;
}

.te-section-header .te-section-title {
    margin-bottom: 0;
}

/* Toolbar */
.te-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 12px;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--border-light);
}

.te-toolbar-left,
.te-toolbar-right {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-wrap: wrap;
}

.te-stat-pill {
    font-size: 12px;
    color: var(--text-tertiary);
    padding: 3px 8px;
    background: var(--bg-secondary);
    border-radius: var(--radius-full);
    white-space: nowrap;
}

.te-stat-pill span {
    font-weight: 600;
    color: var(--text-secondary);
}

.te-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 13px;
    font-weight: 500;
    padding: 7px 14px;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    background: var(--bg-primary);
    color: var(--text-primary);
    cursor: pointer;
    transition: all .15s;
}

.te-btn:hover {
    background: var(--bg-hover);
}

.te-btn-primary {
    background: var(--accent);
    color: #fff;
    border-color: var(--accent);
}

.te-btn-primary:hover {
    background: var(--accent-hover);
}

.te-btn-primary.copied {
    background: var(--success);
    border-color: var(--success);
}

.te-btn-ghost {
    border-color: transparent;
}

.te-btn-ghost:hover {
    background: var(--bg-hover);
    border-color: var(--border-light);
}

.te-btn-sm {
    font-size: 12px;
    padding: 4px 10px;
}

/* Textarea */
.te-textarea {
    min-height: 180px;
    max-height: 400px;
    overflow-y: auto;
    padding: 16px;
    font-size: 16px;
    line-height: 1.7;
    outline: none;
    border: 1px solid var(--border-light);
    border-radius: var(--radius-sm);
    transition: border-color .15s;
    word-break: break-word;
}

.te-textarea:focus {
    border-color: var(--accent);
}

.te-textarea:empty::before {
    content: attr(data-placeholder);
    color: var(--text-tertiary);
    pointer-events: none;
}

/* Social Limits */
.te-stats-card {
    padding: 14px 20px;
}

.te-limits {
    display: grid;
    gap: 10px;
}

.te-limit-row {
    display: flex;
    align-items: center;
    gap: 10px;
}

.te-limit-label {
    font-size: 12px;
    font-weight: 500;
    color: var(--text-tertiary);
    width: 90px;
    flex-shrink: 0;
}

.te-limit-num {
    font-size: 12px;
    color: var(--text-tertiary);
    width: 65px;
    text-align: right;
    flex-shrink: 0;
    font-family: var(--font-mono);
}

.stat-progress-track {
    flex: 1;
    height: 6px;
    background: var(--bg-tertiary);
    border-radius: 3px;
    overflow: hidden;
}

.stat-progress-fill {
    height: 100%;
    width: 0;
    background: var(--accent);
    border-radius: 3px;
    transition: width .3s ease, background .3s;
}

.stat-progress-fill.warning {
    background: #f59e0b;
}

.stat-progress-fill.danger {
    background: #ef4444;
}

/* Unicode Styles */
.te-styles {
    display: grid;
    gap: 6px;
}

.style-row {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 12px;
    background: var(--bg-secondary);
    border-radius: var(--radius-sm);
    border: 1px solid var(--border-light);
}

.style-label {
    font-size: 11px;
    font-weight: 600;
    color: var(--text-tertiary);
    width: 95px;
    flex-shrink: 0;
    text-transform: uppercase;
    letter-spacing: .03em;
}

.style-preview {
    flex: 1;
    font-size: 14px;
    color: var(--text-primary);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.style-copy-btn {
    font-size: 12px;
    padding: 4px 12px;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border);
    background: var(--bg-primary);
    color: var(--text-secondary);
    cursor: pointer;
    transition: all .15s;
    flex-shrink: 0;
}

.style-copy-btn:hover {
    background: var(--bg-hover);
    color: var(--text-primary);
}

.style-copy-btn.copied {
    color: var(--success);
    border-color: var(--success);
}

.styles-empty {
    text-align: center;
    color: var(--text-tertiary);
    font-size: 14px;
    padding: 24px 0;
}

/* Templates */
.te-templates {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.template-btn {
    font-size: 13px;
    padding: 8px 14px;
    background: var(--bg-secondary);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-full);
    color: var(--text-primary);
    cursor: pointer;
    transition: all .15s;
}

.template-btn:hover {
    border-color: var(--accent);
    background: var(--bg-hover);
}

/* History */
.te-history {
    display: grid;
    gap: 6px;
}

.history-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    background: var(--bg-secondary);
    border-radius: var(--radius-sm);
    border: 1px solid var(--border-light);
}

.history-text {
    flex: 1;
    font-size: 13px;
    color: var(--text-primary);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.history-time {
    font-size: 11px;
    color: var(--text-tertiary);
    flex-shrink: 0;
}

.history-copy {
    border: none;
    background: none;
    cursor: pointer;
    font-size: 14px;
    padding: 2px 4px;
    border-radius: 4px;
    transition: background .15s;
}

.history-copy:hover {
    background: var(--bg-hover);
}

.history-empty {
    text-align: center;
    color: var(--text-tertiary);
    font-size: 13px;
    padding: 16px 0;
}

/* Picker sidebar */
.te-picker-card {
    position: sticky;
    top: 80px;
}

.te-search {
    width: 100%;
    padding: 8px 12px;
    font-size: 13px;
    border: 1px solid var(--border-light);
    border-radius: var(--radius-sm);
    background: var(--bg-secondary);
    color: var(--text-primary);
    margin-bottom: 10px;
    outline: none;
    transition: border-color .15s;
}

.te-search:focus {
    border-color: var(--accent);
}

.te-picker-card .picker-tabs {
    margin-bottom: 8px;
    flex-wrap: wrap;
}

.te-picker-card .picker-tab {
    font-size: 16px;
    padding: 4px 6px;
}

.te-picker-card .picker-grid-wrapper {
    max-height: 420px;
    overflow-y: auto;
    scrollbar-width: thin;
}

.te-picker-card .picker-grid {
    display: none;
    grid-template-columns: repeat(auto-fill, minmax(36px, 1fr));
    gap: 2px;
}

.te-picker-card .picker-grid.active {
    display: grid;
}

.te-picker-card .picker-emoji {
    font-size: 22px;
    padding: 4px;
    line-height: 1;
    border: none;
    background: none;
    cursor: pointer;
    border-radius: var(--radius-sm);
    transition: background .1s;
}

.te-picker-card .picker-emoji:hover {
    background: var(--bg-hover);
}

/* Responsive */
@media (max-width: 900px) {
    .te-layout {
        grid-template-columns: 1fr;
    }

    .te-picker-card {
        position: static;
    }

    .te-picker-card .picker-grid-wrapper {
        max-height: 260px;
    }
}

@media (max-width: 480px) {
    .te-toolbar {
        flex-direction: column;
        align-items: flex-start;
    }

    .style-label {
        width: 70px;
        font-size: 10px;
    }
}

/* ─── Show More / Copy Row ─── */
.copy-grid-wrapper {
    position: relative;
    max-height: 330px;
    overflow: hidden;
    transition: max-height 0.4s ease;
}

.copy-grid-wrapper::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 80px;
    background: linear-gradient(transparent, var(--bg-primary) 90%);
    pointer-events: none;
    transition: opacity 0.3s ease;
}

.copy-grid-wrapper.expanded {
    max-height: 1000px;
}

.copy-grid-wrapper.expanded::after {
    opacity: 0;
}

.btn-show-more-container {
    text-align: center;
    position: relative;
    z-index: 10;
    margin-top: -30px;
    transition: margin-top 0.4s ease;
}

#copyCodeGridWrapper.expanded+.btn-show-more-container {
    margin-top: 12px;
}

.btn-show-more {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 6px 16px;
    background: var(--bg-primary);
    color: var(--text-secondary);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-sm);
    font-weight: 500;
    font-size: 13px;
    transition: all 0.2s;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.04);
    cursor: pointer;
}

.btn-show-more:hover {
    background: var(--bg-hover);
    color: var(--text-primary);
    border-color: var(--border);
}