* { box-sizing: border-box; margin: 0; padding: 0; }
body {
    font-family: 'Space Grotesk', -apple-system, BlinkMacSystemFont, sans-serif;
    background: #FAF8F5;
    min-height: 100vh;
    padding: 40px 20px 80px 20px;
    color: #5D4E37;
}
.container {
    max-width: 700px;
    margin: 0 auto;
}
header {
    text-align: center;
    margin-bottom: 40px;
}
.logo {
    font-size: 2.8rem;
    font-weight: 500;
    color: #7B6B5A;
    letter-spacing: 4px;
    text-transform: uppercase;
    cursor: pointer;
    text-decoration: none;
    display: inline-block;
}
.logo:hover {
    color: #5D4E37;
}
.tagline {
    font-size: 1rem;
    color: #8B7B6B;
    margin-top: 8px;
    font-weight: 400;
    letter-spacing: 0.5px;
}
.search-box {
    margin-bottom: 24px;
}
.search-tabs {
    display: flex;
    gap: 0;
    margin-bottom: 20px;
    border-bottom: 2px solid #E0D8CC;
}
.search-tabs button {
    flex: 1;
    padding: 14px 12px;
    border: none;
    background: transparent;
    font-family: inherit;
    font-size: 0.95rem;
    color: #8B7B6B;
    cursor: pointer;
    transition: all 0.2s;
    border-bottom: 2px solid transparent;
    margin-bottom: -2px;
}
.search-tabs button.active {
    color: #5D4E37;
    font-weight: 500;
    border-bottom-color: #7B6B5A;
}
.search-tabs button:hover:not(.active) {
    color: #5D4E37;
    background: #F5F2EF;
}
.search-input {
    display: flex;
    gap: 10px;
    align-items: flex-start;
}
.search-input input {
    width: 100%;
    padding: 16px 20px;
    font-size: 1.1rem;
    font-family: inherit;
    border: 1px solid #C4B8A8;
    border-radius: 8px;
    background: white;
    color: #5D4E37;
    outline: none;
    transition: border-color 0.2s;
}
.search-input input:focus {
    border-color: #7B6B5A;
}
.search-input input::placeholder {
    color: #B5A89A;
}
.search-input button {
    padding: 16px 32px;
    font-size: 1rem;
    font-family: inherit;
    font-weight: 500;
    border: none;
    border-radius: 8px;
    background: #7B6B5A;
    color: #FAF8F5;
    cursor: pointer;
    transition: background 0.2s;
    white-space: nowrap;
    flex-shrink: 0;
}
.search-input button:hover {
    background: #6A5A4A;
}

/* Autocomplete dropdown */
.autocomplete-container {
    position: relative;
    flex: 1;
}
.autocomplete-dropdown {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: white;
    border: 1px solid #C4B8A8;
    border-top: none;
    border-radius: 0 0 8px 8px;
    max-height: 300px;
    overflow-y: auto;
    box-shadow: 0 4px 12px rgba(93, 78, 55, 0.15);
    z-index: 1000;
    display: none;
}
.autocomplete-dropdown.show {
    display: block;
}
.autocomplete-item {
    padding: 12px 20px;
    cursor: pointer;
    border-bottom: 1px solid #F0EBE3;
    transition: background 0.2s;
}
.autocomplete-item:last-child {
    border-bottom: none;
}
.autocomplete-item:hover {
    background: #FAF8F5;
}
.autocomplete-item .word {
    font-weight: 500;
    color: #5D4E37;
    font-size: 1rem;
}
.autocomplete-item .ac-top-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 8px;
}
.autocomplete-item .ac-pos {
    font-size: 0.72rem;
    color: #A89B8B;
    background: #F0EBE3;
    padding: 2px 8px;
    border-radius: 4px;
    white-space: nowrap;
    flex-shrink: 0;
}
.autocomplete-item .preview {
    font-size: 0.85rem;
    color: #8B7B6B;
    margin-top: 2px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* Cross-reference autocomplete (inside suggestion modal) */
.crossref-autocomplete-container {
    position: relative;
}
.crossref-autocomplete-dropdown {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: white;
    border: 1px solid #C4B8A8;
    border-top: none;
    border-radius: 0 0 8px 8px;
    max-height: 200px;
    overflow-y: auto;
    box-shadow: 0 4px 12px rgba(93, 78, 55, 0.15);
    z-index: 2100;
    display: none;
}
.crossref-autocomplete-dropdown.show {
    display: block;
}
.crossref-autocomplete-dropdown .autocomplete-item {
    padding: 10px 16px;
    cursor: pointer;
    border-bottom: 1px solid #F0EBE3;
    transition: background 0.2s;
}
.crossref-autocomplete-dropdown .autocomplete-item:last-child {
    border-bottom: none;
}
.crossref-autocomplete-dropdown .autocomplete-item:hover {
    background: #FAF8F5;
}
.crossref-autocomplete-dropdown .autocomplete-item .word {
    font-weight: 500;
    color: #5D4E37;
    font-size: 0.95rem;
}
.crossref-autocomplete-dropdown .autocomplete-item .preview {
    font-size: 0.8rem;
    color: #8B7B6B;
    margin-top: 2px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* Phrases (Common Phrases phrasebook) */
.phrases-browser { margin-top: 8px; }
.phrases-header { text-align: center; margin-bottom: 24px; }
.phrases-header h2 { font-size: 1.4rem; font-weight: 600; color: #5D4E37; margin: 0 0 4px; }
.phrases-header p { color: #8B7B6B; font-size: 0.95rem; margin: 0; }
.phrases-total { font-size: 0.85rem; color: #A09080; margin-top: 6px; }
.phrase-cat-emoji { font-size: 1.6rem; margin-bottom: 6px; }
.phrase-category-card.coming-soon { opacity: 0.45; cursor: default; }
.phrase-category-card.coming-soon:hover { transform: none; box-shadow: none; border-color: #E0D8CC; }
.phrases-coming-soon-label { font-size: 0.85rem; color: #A09080; margin-top: 28px; margin-bottom: 4px; text-align: center; }
.phrases-empty { text-align: center; padding: 48px 24px; color: #8B7B6B; font-size: 1.05rem; }

.phrases-detail { margin-top: 8px; }
.phrases-detail-header { display: flex; align-items: center; gap: 10px; margin-bottom: 20px; flex-wrap: wrap; }
.phrases-detail-header .phrase-cat-emoji { font-size: 1.5rem; margin-bottom: 0; }
.phrases-detail-header h2 { font-size: 1.3rem; font-weight: 600; color: #5D4E37; margin: 0; }
.phrases-detail-count { font-size: 0.85rem; color: #A09080; }
.back-btn {
    display: inline-flex; align-items: center; gap: 4px;
    background: none; border: 1px solid #E0D8CC; border-radius: 8px;
    padding: 8px 14px; font-size: 0.9rem; color: #7B6B5A;
    cursor: pointer; margin-bottom: 16px; transition: all 0.2s;
}
.back-btn:hover { border-color: #7B6B5A; color: #5D4E37; }

.phrase-list { display: flex; flex-direction: column; gap: 10px; }
.phrase-item {
    background: white; border: 1px solid #E8E3DC; border-radius: 10px;
    padding: 14px 18px; transition: border-color 0.2s;
}
.phrase-item:hover { border-color: #C4B8A8; }
.phrase-english { font-size: 1rem; color: #5D4E37; font-weight: 500; margin-bottom: 5px; }
.phrase-kikuyu { font-size: 1rem; color: #7B6B5A; font-style: italic; }

/* Translate view — Google Translate-style two-box layout */
.translate-view {
    display: none;
}
.translate-view.show {
    display: block;
}
.translate-container {
    display: flex;
    align-items: stretch;
    gap: 0;
    border: 1px solid #C4B8A8;
    border-radius: 12px;
    overflow: hidden;
    background: white;
}
.translate-box {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-height: 200px;
}
.source-box {
    border-right: 1px solid #E0D8CC;
}
.translate-box-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 16px;
    background: #FAF8F5;
    border-bottom: 1px solid #E0D8CC;
}
.lang-label {
    font-weight: 600;
    color: #5D4E37;
    font-size: 0.95rem;
}
.translate-char-count {
    font-size: 0.75rem;
    color: #B0A494;
}
.translate-char-count.warning { color: #C4A35A; }
.translate-char-count.danger { color: #C45A5A; }
#translate-input {
    flex: 1;
    width: 100%;
    min-height: 120px;
    padding: 16px;
    border: none;
    font-family: inherit;
    font-size: 1.1rem;
    color: #5D4E37;
    resize: none;
    box-sizing: border-box;
    background: transparent;
    line-height: 1.6;
}
#translate-input:focus {
    outline: none;
}
#translate-input::placeholder {
    color: #B0A494;
}
.translate-box-footer {
    padding: 4px 12px;
    display: flex;
    justify-content: flex-end;
    min-height: 32px;
}
.clear-btn {
    background: none;
    border: none;
    color: #B0A494;
    cursor: pointer;
    padding: 4px 8px;
    font-size: 1.1rem;
    border-radius: 50%;
    transition: all 0.2s;
    line-height: 1;
}
.clear-btn:hover {
    color: #5D4E37;
    background: #F0ECE6;
}
.swap-btn {
    align-self: center;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    border: 1px solid #E0D8CC;
    background: white;
    font-size: 1.3rem;
    color: #7B6B5A;
    cursor: pointer;
    transition: all 0.2s;
    flex-shrink: 0;
    margin: 0 -22px;
    z-index: 2;
    box-shadow: 0 1px 4px rgba(93, 78, 55, 0.12);
}
.swap-btn:hover {
    background: #F5F2EF;
    border-color: #7B6B5A;
    color: #5D4E37;
}
.translate-output {
    flex: 1;
    padding: 20px 16px 16px;
    font-size: 1.1rem;
    color: #5D4E37;
    line-height: 1.6;
    min-height: 120px;
    background: #FDFCFB;
    word-wrap: break-word;
    overflow-wrap: break-word;
}
.output-placeholder {
    color: #B0A494;
    font-style: italic;
}
.translate-loading {
    color: #B0A494;
    font-style: italic;
}
.community-badge {
    display: inline-block;
    font-size: 0.7rem;
    color: #2E7D32;
    background: #E8F5E9;
    padding: 2px 8px;
    border-radius: 10px;
    margin-top: 8px;
    font-weight: 500;
}
.method-badge {
    display: inline-block;
    font-size: 0.65rem;
    color: #5D4E37;
    background: #F5F2EF;
    padding: 2px 8px;
    border-radius: 10px;
    margin-top: 8px;
    font-weight: 400;
}

/* Feedback area */
.translate-feedback-area {
    margin-top: 12px;
}
.translate-feedback-row {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 16px;
    background: #FAF8F5;
    border-radius: 8px;
}
.translate-feedback-row .feedback-label {
    font-size: 0.85rem;
    color: #8B7B6B;
}
.feedback-thumb {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    border: 1px solid #E0D8CC;
    background: white;
    cursor: pointer;
    font-size: 1rem;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}
.feedback-thumb:hover {
    border-color: #7B6B5A;
}
.feedback-thumb.selected-positive {
    background: #E8F5E9;
    border-color: #66BB6A;
}
.feedback-thumb.selected-negative {
    background: #FFEBEE;
    border-color: #EF5350;
}
.feedback-correction-link {
    font-size: 0.85rem;
    color: #7B6B5A;
    cursor: pointer;
    text-decoration: underline;
    margin-left: auto;
}
.feedback-correction-link:hover { color: #5D4E37; }
.correction-input-area {
    display: none;
    margin-top: 8px;
    padding: 12px 16px;
    background: #FAF8F5;
    border-radius: 8px;
}
.correction-input-area.show { display: block; }
.correction-input-area textarea {
    width: 100%;
    min-height: 60px;
    padding: 10px 12px;
    border: 1px solid #C4B8A8;
    border-radius: 6px;
    font-family: inherit;
    font-size: 0.9rem;
    resize: vertical;
    box-sizing: border-box;
}
.correction-input-area textarea:focus {
    outline: none;
    border-color: #7B6B5A;
}
.correction-submit-btn {
    margin-top: 8px;
    padding: 8px 16px;
    background: #7B6B5A;
    color: white;
    border: none;
    border-radius: 6px;
    font-family: inherit;
    font-size: 0.85rem;
    cursor: pointer;
}
.correction-submit-btn:hover { background: #5D4E37; }
.correction-submit-btn:disabled { background: #C4B8A8; cursor: not-allowed; }

/* Dictionary details expander */
.translate-details {
    margin-top: 12px;
}
.details-toggle {
    background: none;
    border: none;
    color: #7B6B5A;
    cursor: pointer;
    font-family: inherit;
    font-size: 0.85rem;
    text-decoration: underline;
    padding: 4px 0;
}
.details-toggle:hover { color: #5D4E37; }
.details-content {
    margin-top: 10px;
}
.word-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 8px;
}
.word-chip {
    display: inline-flex;
    flex-direction: column;
    padding: 10px 14px;
    border-radius: 8px;
    border: 1px solid #E0D8CC;
    background: white;
    cursor: pointer;
    transition: all 0.2s;
    max-width: 220px;
}
.word-chip:hover {
    border-color: #7B6B5A;
    box-shadow: 0 2px 8px rgba(93, 78, 55, 0.1);
}
.word-chip.found { border-color: #C4B8A8; }
.word-chip.not-found {
    background: #F9F7F4;
    border-color: #E8E3DC;
    cursor: default;
}
.word-chip .chip-word { font-weight: 600; color: #5D4E37; font-size: 0.9rem; }
.word-chip .chip-pos { font-size: 0.72rem; color: #B0A494; font-style: italic; }
.word-chip .chip-def { font-size: 0.78rem; color: #8B7B6B; margin-top: 3px; line-height: 1.3; }
.word-chip.not-found .chip-word { color: #B0A494; }
.word-chip.not-found .chip-def { color: #C4B8A8; font-style: italic; }

.translate-empty {
    text-align: center;
    padding: 30px 20px;
    color: #8B7B6B;
}
.translate-empty p {
    font-size: 0.95rem;
    line-height: 1.5;
}

/* Recent searches */
.recent-searches {
    margin-top: 16px;
    padding: 12px 16px;
    background: #F9F7F4;
    border-radius: 8px;
    display: none;
}
.recent-searches.show {
    display: block;
}
.recent-searches .label {
    font-size: 0.85rem;
    color: #8B7B6B;
    margin-bottom: 8px;
    font-weight: 500;
}
.recent-searches .chips {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}
.recent-searches .chip {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    background: white;
    border: 1px solid #E0D8CC;
    border-radius: 20px;
    font-size: 0.9rem;
    color: #5D4E37;
    cursor: pointer;
    transition: all 0.2s;
}
.recent-searches .chip:hover {
    background: #7B6B5A;
    color: white;
    border-color: #7B6B5A;
}
.recent-searches .chip .remove {
    font-size: 1.1rem;
    line-height: 1;
    opacity: 0.6;
}
.recent-searches .chip:hover .remove {
    opacity: 1;
}

.results {
    margin-top: 32px;
}
.results:empty {
    margin-top: 0;
}
.results-section-divider {
    display: flex;
    align-items: center;
    margin: 24px 0 16px 0;
    color: #8B7B6B;
    font-size: 0.9rem;
    font-weight: 500;
}
.results-section-divider::before,
.results-section-divider::after {
    content: '';
    flex: 1;
    height: 1px;
    background: #D8CFC0;
}
.results-section-divider span {
    padding: 0 16px;
    white-space: nowrap;
}
.result-card {
    background: white;
    border-radius: 12px;
    padding: 28px;
    margin-bottom: 20px;
    box-shadow: 0 2px 12px rgba(93, 78, 55, 0.08);
    border: 1px solid #E8E3DC;
}
/* Tier 1: Hero section — headword + gloss */
.card-tier-1 {
    margin-bottom: 16px;
}
.card-tier-1 .headword {
    display: inline;
}
.hero-pos {
    display: inline-block;
    font-size: 0.78rem;
    color: #A89B8B;
    background: #F0EBE3;
    padding: 2px 10px;
    border-radius: 4px;
    margin-left: 10px;
    vertical-align: middle;
    font-weight: 500;
}
.primary-gloss {
    font-size: 1.2rem;
    font-weight: 500;
    color: #2C2418;
    margin-top: 6px;
    line-height: 1.4;
}
/* Tier 2: Details section */
.card-tier-2 {
    padding-top: 16px;
    border-top: 1px solid #E8E3DC;
}
/* Tier 3: Deep dive (collapsed by default) */
.card-tier-3 {
    margin-top: 16px;
    padding-top: 16px;
    border-top: 1px solid #E8E3DC;
}
.tier3-toggle {
    background: none;
    border: none;
    color: #7B6B5A;
    cursor: pointer;
    font-family: inherit;
    font-size: 0.85rem;
    text-decoration: underline;
    padding: 0;
}
.tier3-toggle:hover {
    color: #5D4E37;
}
.tier3-content {
    display: none;
    margin-top: 12px;
}
.card-tier-3.expanded .tier3-content {
    display: block;
}
.result-card .headword {
    font-size: 1.8rem;
    font-weight: 600;
    color: #5D4E37;
}

/* Improved variant display */
.result-card .word-info {
    font-size: 0.9rem;
    color: #8B7B6B;
    margin-bottom: 16px;
    line-height: 1.6;
}
.result-card .word-info .pos {
    font-weight: 500;
    color: #7B6B5A;
}
.result-card .word-info .pronunciation {
    font-style: italic;
    color: #9B8B7B;
}
.result-card .word-info .noun-class {
    background: #F0EBE3;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 0.85rem;
    margin-left: 8px;
}
.result-card .related-forms {
    font-size: 0.85rem;
    color: #8B7B6B;
    margin-top: 6px;
}
.result-card .related-forms span {
    background: #F5F2EF;
    padding: 3px 10px;
    border-radius: 4px;
    margin-right: 6px;
    display: inline-block;
    margin-bottom: 4px;
}

.result-card .section-label {
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: #A89B8B;
    margin-bottom: 8px;
    margin-top: 16px;
    padding-top: 16px;
    border-top: 1px solid #E8E3DC;
}
.result-card .definition {
    font-size: 1.05rem;
    line-height: 1.7;
    color: #5D4E37;
}
.result-card .definition .def-num {
    font-weight: 600;
    color: #7B6B5A;
    margin-right: 6px;
}
.result-card .examples {
    font-size: 0.95rem;
    color: #7B6B5A;
    margin-top: 12px;
    padding-left: 16px;
    border-left: 3px solid #E8E3DC;
}
.result-card .cross-ref {
    margin-top: 12px;
}
.result-card .cross-ref a {
    color: #7B6B5A;
    text-decoration: none;
    border-bottom: 1px dashed #C4B8A8;
    cursor: pointer;
}
.result-card .cross-ref a:hover {
    color: #5D4E37;
    border-bottom-color: #7B6B5A;
}
.result-card .usage-examples {
    margin-top: 16px;
    padding-top: 16px;
    border-top: 1px solid #E8E3DC;
}
.result-card .usage-examples .example-item {
    margin-bottom: 12px;
    padding: 12px;
    background: #F9F7F4;
    border-radius: 6px;
}
.result-card .usage-examples .example-gikuyu {
    font-size: 0.95rem;
    color: #5D4E37;
    line-height: 1.6;
    margin-bottom: 4px;
}
.result-card .usage-examples .example-english {
    font-size: 0.9rem;
    color: #8B7B6B;
    font-style: italic;
    line-height: 1.5;
}
.result-card .usage-examples .reference {
    font-size: 0.8rem;
    color: #A89B8B;
    margin-top: 4px;
}
.result-card .word-stats {
    margin-top: 12px;
    font-size: 0.85rem;
    color: #8B7B6B;
}
.result-card .word-stats .stat-item {
    display: inline-block;
    margin-right: 16px;
    margin-bottom: 4px;
}
.result-card .word-stats .stat-label {
    font-weight: 500;
    color: #7B6B5A;
}
.discover-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: 100%;
    padding: 14px 20px;
    margin-top: 16px;
    font-size: 0.95rem;
    font-family: inherit;
    font-weight: 500;
    color: #7B6B5A;
    background: transparent;
    border: 1px dashed #C4B8A8;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s;
}
.discover-btn:hover {
    background: #F5F2EF;
    border-color: #7B6B5A;
}
.discover-btn .icon {
    font-size: 1.1rem;
}
.no-results {
    text-align: center;
    padding: 48px 24px;
    color: #8B7B6B;
}
.no-results-box {
    background: white;
    border: 1px solid #E8E3DC;
    border-radius: 12px;
    padding: 40px 32px;
    max-width: 400px;
    margin: 0 auto;
}
.no-results-box h3 {
    font-size: 1.1rem;
    font-weight: 500;
    color: #5D4E37;
    margin-bottom: 12px;
}
.no-results-box p {
    font-size: 0.95rem;
    color: #8B7B6B;
    line-height: 1.6;
    margin-bottom: 20px;
}
.no-results-box .suggestions {
    font-size: 0.9rem;
    color: #A89B8B;
    margin-bottom: 20px;
}
.no-results-box .suggestions ul {
    list-style: none;
    padding: 0;
    margin-top: 8px;
}
.no-results-box .suggestions li {
    padding: 4px 0;
}
.no-results-box .discover-fallback {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 10px 20px;
    background: #F5F2EF;
    border: 1px solid #E0D8CC;
    border-radius: 6px;
    color: #7B6B5A;
    font-size: 0.9rem;
    cursor: pointer;
    transition: all 0.2s;
}
.no-results-box .discover-fallback:hover {
    background: #7B6B5A;
    color: white;
    border-color: #7B6B5A;
}
.loading {
    text-align: center;
    padding: 40px 20px;
    color: #8B7B6B;
}
.back-btn {
    display: inline-block;
    padding: 8px 16px;
    margin-bottom: 20px;
    font-size: 0.9rem;
    color: #7B6B5A;
    background: transparent;
    border: 1px solid #C4B8A8;
    border-radius: 6px;
    cursor: pointer;
    font-family: inherit;
}
.back-btn:hover {
    background: #F0EBE3;
}

/* Footer */
footer {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: #FAF8F5;
    border-top: 1px solid #E8E3DC;
    padding: 16px 20px;
    text-align: center;
    font-size: 0.85rem;
    color: #A89B8B;
}
footer .mission {
    font-size: 0.8rem;
    color: #7B6B5A;
    margin-bottom: 8px;
    font-style: italic;
}
footer .links {
    font-size: 0.8rem;
}
footer a {
    color: #7B6B5A;
    text-decoration: none;
}
footer a:hover {
    text-decoration: underline;
}
footer .separator {
    margin: 0 10px;
    color: #C4B8A8;
}

/* Category Browser */
.category-browser {
    margin-top: 20px;
}
.category-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 12px;
    margin-top: 16px;
}
.category-card {
    background: white;
    border: 1px solid #E0D8CC;
    border-radius: 10px;
    padding: 16px;
    cursor: pointer;
    transition: all 0.2s;
    text-align: center;
}
.category-card:hover {
    border-color: #7B6B5A;
    box-shadow: 0 4px 12px rgba(93, 78, 55, 0.12);
    transform: translateY(-2px);
}
.category-card .name {
    font-weight: 500;
    color: #5D4E37;
    font-size: 1rem;
    margin-bottom: 4px;
}
.category-card .count {
    font-size: 0.85rem;
    color: #8B7B6B;
}
.subcategory-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin: 16px 0;
}
.subcategory-chip {
    padding: 8px 16px;
    background: #F5F2EF;
    border: 1px solid #E0D8CC;
    border-radius: 20px;
    font-size: 0.9rem;
    color: #5D4E37;
    cursor: pointer;
    transition: all 0.2s;
}
.subcategory-chip:hover, .subcategory-chip.active {
    background: #7B6B5A;
    color: white;
    border-color: #7B6B5A;
}
.subcategory-chip .chip-count {
    background: rgba(0,0,0,0.1);
    padding: 2px 8px;
    border-radius: 10px;
    margin-left: 6px;
    font-size: 0.8rem;
}
.category-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 20px;
}
.category-header h2 {
    font-size: 1.5rem;
    font-weight: 500;
    color: #5D4E37;
    margin: 0;
}
.category-header .total {
    font-size: 0.9rem;
    color: #8B7B6B;
}
.entry-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}
.entry-item {
    background: white;
    border-radius: 8px;
    padding: 14px 18px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    cursor: pointer;
    transition: all 0.2s;
    border: 1px solid #E8E3DC;
}
.entry-item:hover {
    border-color: #7B6B5A;
    box-shadow: 0 2px 8px rgba(93, 78, 55, 0.08);
}
.entry-item .word {
    font-weight: 500;
    color: #5D4E37;
    font-size: 1.05rem;
}
.entry-item .def {
    font-size: 0.9rem;
    color: #8B7B6B;
    margin-top: 2px;
}
.entry-item .pos {
    font-size: 0.8rem;
    color: #A89B8B;
    background: #F5F2EF;
    padding: 4px 10px;
    border-radius: 4px;
    flex-shrink: 0;
}
.browse-section-label {
    font-size: 0.85rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: #A89B8B;
    margin: 24px 0 12px 0;
}

/* Alphabet Browse Strip */
.alphabet-strip {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-bottom: 24px;
    padding: 16px;
    background: #F9F7F4;
    border-radius: 10px;
}
.alphabet-strip .letter {
    min-width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.95rem;
    font-weight: 500;
    color: #7B6B5A;
    background: white;
    border: 1px solid #E0D8CC;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s;
}
.alphabet-strip .letter:hover {
    background: #7B6B5A;
    color: white;
    border-color: #7B6B5A;
}
.alphabet-strip .letter.active {
    background: #7B6B5A;
    color: white;
    border-color: #7B6B5A;
}
.alphabet-strip .letter.disabled {
    color: #C4B8A8;
    cursor: default;
    background: #F5F2EF;
}
.alphabet-strip .letter.disabled:hover {
    background: #F5F2EF;
    color: #C4B8A8;
    border-color: #E0D8CC;
}

/* Share Buttons */
.share-buttons {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 20px;
    padding-top: 20px;
    border-top: 1px solid #E8E3DC;
}
.share-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 14px;
    font-size: 0.85rem;
    font-family: inherit;
    color: #7B6B5A;
    background: #F5F2EF;
    border: 1px solid #E0D8CC;
    border-radius: 6px;
    cursor: pointer;
    text-decoration: none;
    transition: all 0.2s;
}
.share-btn:hover {
    background: #7B6B5A;
    color: white;
    border-color: #7B6B5A;
}
.share-btn svg {
    flex-shrink: 0;
}
.share-btn.twitter:hover { background: #000; border-color: #000; }
.share-btn.facebook:hover { background: #1877F2; border-color: #1877F2; }
.share-btn.whatsapp:hover { background: #25D366; border-color: #25D366; }
.share-btn.suggest:hover { background: #8B7B6B; border-color: #8B7B6B; }

/* Auth header button */
.auth-header {
    position: fixed;
    top: 16px;
    right: 16px;
    z-index: 100;
}
.auth-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 14px;
    font-size: 0.85rem;
    font-family: inherit;
    background: white;
    color: #5D4E37;
    border: 1px solid #C4B8A8;
    border-radius: 20px;
    cursor: pointer;
    transition: all 0.2s;
}
.auth-btn:hover {
    background: #F5F2EF;
    border-color: #7B6B5A;
}
.auth-btn img {
    width: 24px;
    height: 24px;
    border-radius: 50%;
}
.auth-btn .user-avatar-initial {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: #7B6B5A;
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.8rem;
    font-weight: 600;
    flex-shrink: 0;
}
.auth-btn .user-name {
    max-width: 120px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* Modal overlay */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(93, 78, 55, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2000;
    padding: 20px;
    opacity: 0;
    visibility: hidden;
    transition: all 0.2s;
}
.modal-overlay.show {
    opacity: 1;
    visibility: visible;
}

/* Modal content */
.modal {
    background: white;
    border-radius: 12px;
    padding: 28px;
    max-width: 440px;
    width: 100%;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 8px 32px rgba(93, 78, 55, 0.2);
    transform: translateY(20px);
    transition: transform 0.2s;
}
#suggestion-modal .modal {
    max-width: 520px;
}
.modal-overlay.show .modal {
    transform: translateY(0);
}
.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 20px;
}
.modal-title {
    font-size: 1.3rem;
    font-weight: 500;
    color: #5D4E37;
}
.modal-subtitle {
    font-size: 0.9rem;
    color: #8B7B6B;
    margin-top: 4px;
}
.modal-close {
    background: none;
    border: none;
    font-size: 1.5rem;
    color: #8B7B6B;
    cursor: pointer;
    padding: 0;
    line-height: 1;
}
.modal-close:hover {
    color: #5D4E37;
}

/* Login modal */
.login-options {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-top: 16px;
}
.oauth-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    padding: 14px 20px;
    font-size: 1rem;
    font-family: inherit;
    font-weight: 500;
    border: 1px solid #E0D8CC;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s;
}
.oauth-btn svg {
    flex-shrink: 0;
}
.oauth-btn.google {
    background: white;
    color: #5D4E37;
}
.oauth-btn.google:hover {
    background: #F5F2EF;
    border-color: #4285F4;
}
.oauth-btn.facebook {
    background: #1877F2;
    color: white;
    border-color: #1877F2;
}
.oauth-btn.facebook:hover {
    background: #166FE5;
}
.login-note {
    font-size: 0.8rem;
    color: #8B7B6B;
    text-align: center;
    margin-top: 16px;
}
.terms-consent {
    margin-top: 16px;
    padding: 12px 16px;
    background: #F9F7F4;
    border-radius: 8px;
}
.checkbox-label {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    cursor: pointer;
    font-size: 0.85rem;
    color: #5D4E37;
    line-height: 1.5;
}
.checkbox-label input[type="checkbox"] {
    margin-top: 3px;
    width: 18px;
    height: 18px;
    accent-color: #7B6B5A;
    flex-shrink: 0;
    cursor: pointer;
}
.checkbox-label a {
    color: #7B6B5A;
    text-decoration: underline;
}
.checkbox-label a:hover {
    color: #5D4E37;
}
.oauth-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    pointer-events: none;
}

/* Suggestion form */
.suggestion-form {
    display: flex;
    flex-direction: column;
    gap: 16px;
}
.suggestion-form label {
    font-size: 0.9rem;
    font-weight: 500;
    color: #5D4E37;
    margin-bottom: 4px;
    display: block;
}
.suggestion-form select,
.suggestion-form input[type="text"] {
    width: 100%;
    padding: 12px 16px;
    font-family: inherit;
    font-size: 0.95rem;
    border: 1px solid #C4B8A8;
    border-radius: 8px;
    background: white;
    color: #5D4E37;
    box-sizing: border-box;
}
.suggestion-form select { cursor: pointer; }
.suggestion-form select:focus,
.suggestion-form input[type="text"]:focus {
    outline: none;
    border-color: #7B6B5A;
}
.suggestion-form textarea {
    width: 100%;
    padding: 12px 16px;
    font-family: inherit;
    font-size: 0.95rem;
    border: 1px solid #C4B8A8;
    border-radius: 8px;
    background: white;
    color: #5D4E37;
    resize: vertical;
    min-height: 100px;
    box-sizing: border-box;
}
.suggestion-form textarea:focus {
    outline: none;
    border-color: #7B6B5A;
}
.textarea-wrapper {
    position: relative;
}
.char-counter {
    text-align: right;
    font-size: 0.8rem;
    color: #8B7B6B;
    margin-top: 4px;
}
.char-counter.warning { color: #E67E22; }
.char-counter.error { color: #E74C3C; }
.suggestion-form .btn-row {
    display: flex;
    gap: 12px;
    justify-content: flex-end;
    margin-top: 8px;
}
.suggestion-form button {
    padding: 12px 24px;
    font-size: 0.95rem;
    font-family: inherit;
    font-weight: 500;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s;
}
.suggestion-form .btn-cancel {
    background: transparent;
    border: 1px solid #C4B8A8;
    color: #5D4E37;
}
.suggestion-form .btn-cancel:hover {
    background: #F5F2EF;
}
.suggestion-form .btn-submit {
    background: #7B6B5A;
    border: none;
    color: white;
}
.suggestion-form .btn-submit:hover {
    background: #6A5A4A;
}
.suggestion-form .btn-submit:disabled {
    background: #C4B8A8;
    cursor: not-allowed;
}

/* Suggestion type cards */
.suggestion-type-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
}
.suggestion-type-card {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 14px 12px;
    background: #FAF8F5;
    border: 2px solid #E8E3DC;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.2s;
    text-align: left;
    font-family: inherit;
    color: #5D4E37;
}
.suggestion-type-card:hover {
    border-color: #7B6B5A;
    background: #F5F2EF;
}
.suggestion-type-card.selected {
    border-color: #7B6B5A;
    background: #F0EDE8;
}
.suggestion-type-card .type-icon {
    font-size: 1.3rem;
    flex-shrink: 0;
    width: 28px;
    text-align: center;
}
.suggestion-type-card .type-info {
    min-width: 0;
}
.suggestion-type-card .type-label {
    font-weight: 600;
    font-size: 0.88rem;
    line-height: 1.2;
}
.suggestion-type-card .type-desc {
    font-size: 0.75rem;
    color: #8B7B6B;
    margin-top: 2px;
    line-height: 1.3;
}
.suggestion-type-card.full-width {
    grid-column: 1 / -1;
}

/* Suggestion step indicator */
.suggestion-steps {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 16px;
}
.suggestion-step-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #D4CBC0;
    transition: all 0.2s;
}
.suggestion-step-dot.active {
    background: #7B6B5A;
    width: 24px;
    border-radius: 4px;
}

/* Current value display */
.current-value-box {
    background: #FAF8F5;
    border: 1px solid #E8E3DC;
    border-radius: 8px;
    padding: 10px 14px;
    margin-bottom: 4px;
}
.current-value-label {
    font-size: 0.78rem;
    color: #8B7B6B;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 4px;
}
.current-value-text {
    font-size: 0.9rem;
    color: #5D4E37;
    line-height: 1.4;
}
.current-value-text.empty {
    font-style: italic;
    color: #B0A494;
}

/* Definition radio buttons */
.def-radio-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-bottom: 8px;
}
.def-radio-item {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    padding: 8px 12px;
    background: #FAF8F5;
    border: 1px solid #E8E3DC;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.15s;
}
.def-radio-item:hover { border-color: #C4B8A8; }
.def-radio-item.selected {
    border-color: #7B6B5A;
    background: #F0EDE8;
}
.def-radio-item input[type="radio"] {
    margin-top: 3px;
    accent-color: #7B6B5A;
}
.def-radio-item .def-text {
    font-size: 0.88rem;
    color: #5D4E37;
    line-height: 1.4;
}
.def-radio-item .def-label {
    font-size: 0.75rem;
    color: #8B7B6B;
    font-weight: 600;
}

.entry-preview {
    background: #FAF8F5;
    padding: 12px 16px;
    border-radius: 8px;
    border-left: 3px solid #7B6B5A;
}
.entry-preview .headword {
    font-weight: 600;
    color: #5D4E37;
}
.entry-preview .definition {
    font-size: 0.9rem;
    color: #8B7B6B;
    margin-top: 4px;
}

/* User dropdown */
.user-dropdown {
    position: absolute;
    top: 100%;
    right: 0;
    margin-top: 8px;
    background: white;
    border: 1px solid #E0D8CC;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(93, 78, 55, 0.15);
    min-width: 180px;
    display: none;
}
.user-dropdown.show {
    display: block;
}
.user-dropdown a, .user-dropdown button {
    display: block;
    width: 100%;
    padding: 12px 16px;
    text-align: left;
    font-size: 0.9rem;
    font-family: inherit;
    color: #5D4E37;
    text-decoration: none;
    background: none;
    border: none;
    cursor: pointer;
    transition: background 0.2s;
}
.user-dropdown a:hover, .user-dropdown button:hover {
    background: #FAF8F5;
}
.user-dropdown .divider {
    height: 1px;
    background: #E8E3DC;
    margin: 4px 0;
}

/* Toast notification */
.toast {
    position: fixed;
    bottom: 100px;
    left: 50%;
    transform: translateX(-50%);
    background: #5D4E37;
    color: white;
    padding: 12px 24px;
    border-radius: 8px;
    font-size: 0.9rem;
    animation: fadeInOut 2.5s ease forwards;
    z-index: 1000;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}
@keyframes fadeInOut {
    0% { opacity: 0; transform: translateX(-50%) translateY(20px); }
    15% { opacity: 1; transform: translateX(-50%) translateY(0); }
    85% { opacity: 1; transform: translateX(-50%) translateY(0); }
    100% { opacity: 0; transform: translateX(-50%) translateY(-20px); }
}

/* Disambiguation page */
.disambiguation {
    background: white;
    border-radius: 12px;
    padding: 24px;
    border: 1px solid #E8E3DC;
}
.disambiguation h2 {
    font-size: 1.3rem;
    font-weight: 500;
    color: #5D4E37;
    margin-bottom: 8px;
}
.disambiguation p {
    color: #8B7B6B;
    margin-bottom: 20px;
}
.disambig-item {
    flex-direction: row;
    align-items: stretch;
    gap: 12px;
}
.disambig-left {
    flex: 1;
    min-width: 0;
}
.disambig-header {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}
.sense-num {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: #7B6B5A;
    color: white;
    font-size: 0.75rem;
    font-weight: 600;
    flex-shrink: 0;
}
.sense-superscript {
    font-size: 0.65em;
    vertical-align: super;
    color: #7B6B5A;
    font-weight: 600;
    margin-left: 1px;
}
.pos-badge {
    font-size: 0.7rem;
    color: #7B6B5A;
    background: #F0EBE4;
    padding: 2px 8px;
    border-radius: 10px;
    font-weight: 500;
    white-space: nowrap;
}
.sense-label {
    font-size: 0.8rem;
    color: #A89B8B;
    font-style: italic;
    margin-top: 2px;
    margin-left: 32px;
}
.disambig-arrow {
    display: flex;
    align-items: center;
    font-size: 1.4rem;
    color: #C4B8A8;
    flex-shrink: 0;
    padding-left: 8px;
}
.ac-sense {
    font-size: 0.75rem;
    color: #A89B8B;
    font-style: italic;
    margin-left: 6px;
}

/* Mobile bottom search FAB (hidden by default, shown via JS) */
.mobile-search-fab {
    display: none;
    position: fixed;
    bottom: 24px;
    right: 24px;
    width: 56px;
    height: 56px;
    border-radius: 50%;
    background: #7B6B5A;
    color: white;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 16px rgba(93, 78, 55, 0.3);
    cursor: pointer;
    z-index: 90;
    transition: transform 0.2s, box-shadow 0.2s;
}
.mobile-search-fab:active {
    transform: scale(0.95);
}

/* Compact header mode (non-home views) */
.sticky-bar.compact {
    position: sticky;
    top: 0;
    z-index: 50;
    background: #FAF8F5;
    padding: 8px 0 0 0;
    border-bottom: 1px solid #E8E3DC;
    margin-bottom: 16px;
}
.sticky-bar.compact header {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-bottom: 8px;
    text-align: left;
}
.sticky-bar.compact .logo {
    font-size: 1.4rem;
    letter-spacing: 2px;
}
.sticky-bar.compact .tagline {
    display: none;
}
.sticky-bar.compact .search-box {
    margin-bottom: 0;
}
.sticky-bar.compact .search-tabs {
    margin-bottom: 8px;
}
.sticky-bar.compact .search-input input {
    padding: 10px 16px;
    font-size: 0.95rem;
}
.sticky-bar.compact .search-input button {
    padding: 10px 20px;
    font-size: 0.9rem;
}
.sticky-bar.compact #recent-searches {
    display: none !important;
}

@media (max-width: 600px) {
    .logo { font-size: 2rem; }
    .tagline { font-size: 0.9rem; }
    .search-input { flex-direction: column; }
    .search-input input { width: 100%; }
    .search-input button { width: 100%; }
    .autocomplete-container { width: 100%; }
    .autocomplete-item { padding: 14px 20px; min-height: 44px; }
    /* Translate: stack vertically on mobile */
    .translate-container {
        flex-direction: column;
    }
    .source-box {
        border-right: none;
        border-bottom: 1px solid #E0D8CC;
    }
    .swap-btn {
        margin: -22px auto;
        transform: rotate(90deg);
    }
    #translate-input {
        font-size: 16px; /* prevents iOS zoom */
        min-height: 100px;
    }
    .translate-output {
        min-height: 100px;
    }
    .search-tabs button { font-size: 0.85rem; padding: 12px 8px; }
    .category-grid { grid-template-columns: repeat(2, 1fr); }
    .alphabet-strip { gap: 4px; padding: 12px; }
    .alphabet-strip .letter { min-width: 32px; height: 32px; font-size: 0.85rem; }
    .no-results-box { padding: 32px 20px; }
    footer {
        position: relative;
        margin-top: 40px;
        padding: 20px;
    }
    footer .mission { margin-bottom: 10px; }
    body {
        padding-bottom: 20px;
    }
    /* Auth button: show only avatar on small screens */
    .auth-btn {
        padding: 6px 10px;
    }
    .auth-btn .user-name {
        display: none;
    }
    .auth-btn img {
        width: 28px;
        height: 28px;
    }
    /* Mobile search FAB */
    .mobile-search-fab.visible {
        display: flex;
    }
    /* Suggestion modal: full-width on mobile */
    .modal-overlay {
        padding: 12px;
        align-items: flex-start;
        padding-top: 60px;
    }
    .modal {
        padding: 20px;
        max-height: calc(100vh - 80px);
        overflow-y: auto;
    }
    .modal-title {
        font-size: 1.15rem;
    }
    .suggestion-form select,
    .suggestion-form textarea,
    .suggestion-form input[type="text"] {
        font-size: 16px; /* prevents iOS zoom on focus */
    }
    .suggestion-type-grid {
        grid-template-columns: 1fr;
    }
    .suggestion-type-card .type-desc {
        display: none;
    }
    .wotd-card { margin: 0 -8px; }
    .wotd-headword { font-size: 1.6rem; }
    .conjugation-table { font-size: 0.8rem; }
    .conjugation-table th, .conjugation-table td { padding: 6px 8px; }
    .pwa-install-banner { left: 12px; right: 12px; bottom: 12px; border-radius: 12px; }
}

/* ============================================
   Word of the Day
   ============================================ */
.wotd-card {
    background: linear-gradient(135deg, #FBF7F0 0%, #F5EDE0 100%);
    border: 1px solid #D4C8B0;
    border-left: 4px solid #7B6B5A;
    border-radius: 12px;
    padding: 24px;
    margin-bottom: 24px;
    cursor: pointer;
    transition: all 0.2s ease;
    position: relative;
}
.wotd-card:hover {
    box-shadow: 0 4px 16px rgba(93, 78, 55, 0.12);
    transform: translateY(-1px);
}
.wotd-badge {
    display: inline-block;
    background: #7B6B5A;
    color: white;
    font-size: 0.7rem;
    font-weight: 600;
    letter-spacing: 1px;
    text-transform: uppercase;
    padding: 3px 10px;
    border-radius: 4px;
    margin-bottom: 12px;
}
.wotd-headword {
    font-size: 1.8rem;
    font-weight: 600;
    color: #5D4E37;
    margin-bottom: 4px;
}
.wotd-pos {
    display: inline-block;
    font-size: 0.85rem;
    color: #8B7B6B;
    font-style: italic;
    margin-bottom: 8px;
}
.wotd-gloss {
    font-size: 1.05rem;
    color: #5D4E37;
    line-height: 1.5;
    margin-bottom: 8px;
}
.wotd-example {
    font-size: 0.9rem;
    color: #8B7B6B;
    font-style: italic;
    margin-bottom: 12px;
    padding-left: 12px;
    border-left: 2px solid #D4C8B0;
}
.wotd-actions {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}
.wotd-share {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 6px 12px;
    font-size: 0.8rem;
    color: #7B6B5A;
    background: rgba(255,255,255,0.7);
    border: 1px solid #D4C8B0;
    border-radius: 6px;
    cursor: pointer;
    text-decoration: none;
    font-family: inherit;
    transition: all 0.2s;
}
.wotd-share:hover {
    background: white;
    border-color: #7B6B5A;
}

/* ============================================
   Did You Mean? Suggestions
   ============================================ */
.did-you-mean {
    background: #FFF8ED;
    border: 1px solid #E8DCC8;
    border-radius: 8px;
    padding: 12px 16px;
    margin-bottom: 16px;
    font-size: 0.95rem;
    color: #5D4E37;
}
.dym-link {
    color: #7B6B5A;
    font-weight: 600;
    text-decoration: underline;
    text-underline-offset: 2px;
    cursor: pointer;
    transition: color 0.2s;
}
.dym-link:hover {
    color: #5D4E37;
}

/* ============================================
   Verb Conjugation
   ============================================ */
.conjugation-section {
    border-top: 1px solid #E8E3DC;
    margin-top: 8px;
    padding-top: 8px;
}
.conjugation-toggle {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 16px;
    font-size: 0.85rem;
    font-family: inherit;
    font-weight: 500;
    color: #7B6B5A;
    background: #F5F2EF;
    border: 1px solid #E0D8CC;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s;
}
.conjugation-toggle::before {
    content: '▸';
    display: inline-block;
    transition: transform 0.2s;
}
.conjugation-toggle.expanded::before {
    transform: rotate(90deg);
}
.conjugation-toggle:hover {
    background: #EDE8E0;
    border-color: #C4B8A8;
}
.conjugation-body {
    margin-top: 12px;
}
.conjugation-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.85rem;
    margin: 8px 0 12px 0;
    background: white;
    border-radius: 8px;
    overflow: hidden;
    border: 1px solid #E8E3DC;
}
.conjugation-table thead {
    background: #F5F2EF;
}
.conjugation-table th {
    padding: 8px 10px;
    text-align: left;
    font-weight: 600;
    color: #5D4E37;
    font-size: 0.8rem;
    border-bottom: 2px solid #E0D8CC;
}
.conjugation-table td {
    padding: 8px 10px;
    color: #5D4E37;
    border-bottom: 1px solid #F0EBE3;
}
.conjugation-table tbody tr:nth-child(even) {
    background: #FAFAF8;
}
.conjugation-table tbody tr:hover {
    background: #F5F2EF;
}
.tense-marker {
    font-size: 0.7rem;
    color: #A89B8B;
    font-weight: 400;
    margin-top: 2px;
}
.person-label {
    font-weight: 500;
    color: #7B6B5A;
    white-space: nowrap;
}
.loading-conjugation {
    padding: 16px;
    text-align: center;
    color: #A89B8B;
    font-size: 0.85rem;
}
.derived-forms {
    margin-top: 12px;
}
.derived-pills {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 8px;
}
.derived-pill {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    background: #F5F2EF;
    border: 1px solid #E0D8CC;
    border-radius: 20px;
    font-size: 0.85rem;
    color: #5D4E37;
}
.derived-label {
    font-size: 0.75rem;
    color: #A89B8B;
    text-transform: capitalize;
}

/* ============================================
   Word Family
   ============================================ */
.word-family-section {
    border-top: 1px solid #E8E3DC;
    margin-top: 8px;
    padding-top: 8px;
}
.word-family-body {
    margin-top: 12px;
}
.word-family-groups {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-top: 8px;
}
.family-group {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    gap: 6px;
}
.family-label {
    font-size: 0.75rem;
    font-weight: 600;
    color: #A89B8B;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    min-width: 100px;
    flex-shrink: 0;
}
.family-member {
    display: inline-flex;
    align-items: baseline;
    gap: 4px;
    padding: 4px 10px;
    background: #F5F2EF;
    border: 1px solid #E0D8CC;
    border-radius: 16px;
    font-size: 0.85rem;
    color: #5D4E37;
    text-decoration: none;
    cursor: pointer;
    transition: all 0.2s;
}
.family-member:hover {
    background: #EDE8E0;
    border-color: #C4B8A8;
}
.family-member.family-current {
    background: #7B6B5A;
    color: white;
    border-color: #7B6B5A;
}
.family-pos {
    font-size: 0.7rem;
    color: #A89B8B;
    font-style: italic;
}
.family-current .family-pos {
    color: rgba(255,255,255,0.7);
}
.family-def {
    font-size: 0.75rem;
    color: #8B7D6B;
    max-width: 200px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.family-current .family-def {
    color: rgba(255,255,255,0.7);
}
@media (max-width: 600px) {
    .family-label {
        min-width: auto;
        width: 100%;
    }
    .family-def {
        display: none;
    }
}

/* ============================================
   PWA Install Banner
   ============================================ */
.pwa-install-banner {
    position: fixed;
    bottom: 20px;
    left: 20px;
    right: 20px;
    max-width: 500px;
    margin: 0 auto;
    background: white;
    border: 1px solid #D4C8B0;
    border-radius: 16px;
    padding: 16px 20px;
    box-shadow: 0 8px 32px rgba(93, 78, 55, 0.2);
    z-index: 1000;
    animation: slideUp 0.3s ease-out;
}
@keyframes slideUp {
    from { transform: translateY(100px); opacity: 0; }
    to { transform: translateY(0); opacity: 1; }
}
.pwa-install-content {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}
.pwa-install-text {
    font-size: 0.9rem;
    color: #5D4E37;
}
.pwa-install-buttons {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-shrink: 0;
}
.pwa-install-btn {
    padding: 8px 20px;
    background: #7B6B5A;
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 0.85rem;
    font-family: inherit;
    font-weight: 500;
    cursor: pointer;
    transition: background 0.2s;
}
.pwa-install-btn:hover {
    background: #5D4E37;
}
.pwa-dismiss-btn {
    padding: 6px 10px;
    background: transparent;
    color: #A89B8B;
    border: none;
    font-size: 1.1rem;
    cursor: pointer;
    border-radius: 4px;
    transition: color 0.2s;
}
.pwa-dismiss-btn:hover {
    color: #5D4E37;
}
/* PWA install banner — step-by-step layout (iOS + Android fallback browsers) */
.pwa-ios-header {
    font-size: 1rem;
    color: #5D4E37;
    margin-bottom: 12px;
}
.pwa-ios-steps {
    display: flex;
    flex-direction: column;
    gap: 10px;
}
.pwa-ios-step {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 0.9rem;
    color: #5D4E37;
    line-height: 1.4;
    flex-wrap: wrap;
}
.pwa-ios-step-num {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: #7B6B5A;
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.75rem;
    font-weight: 600;
    flex-shrink: 0;
}
.pwa-ios-arrow {
    text-align: center;
    font-size: 2rem;
    color: #7B6B5A;
    line-height: 1;
    margin-top: 6px;
    animation: bounceDown 1.5s ease-in-out infinite;
}
@keyframes bounceDown {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(6px); }
}
.ios-dismiss {
    position: absolute;
    top: 10px;
    right: 10px;
    padding: 4px 8px;
    font-size: 1.2rem;
}
