/* =========================================================
   COLOR TOKENS — WORD PAGE
   ========================================================= */

:root {
    --accent: #1f2937;
    --accent-dark: #111827;
    --accent-bg: #f3f4f6;
    --accent-border: #e5e7eb;
}


/* =========================================================
   WORD PAGE SHELL
   ========================================================= */

.word-page {
    max-width: 720px;
    margin: 0 auto;
    padding: 24px 16px 64px;
}

.word-entry {
    display: flex;
    flex-direction: column;
}


/* =========================================================
   GENERIC CARD
   ========================================================= */

.card {
    padding: 32px;

    background: #ffffff;
    border: 1px solid #e5e7eb;
    border-radius: 20px;
}

.card-divider {
    height: 1px;
    margin: 28px 0;
    background: #e5e7eb;
}


/* =========================================================
   WORD HERO
   ========================================================= */

.word-hero {
    text-align: center;
}

.eyebrow {
    margin: 0 0 14px;

    color: #94a3b8;
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.1em;
    text-transform: uppercase;
}

.word-hero h1 {
    margin: 0;

    color: #111827;
    font-size: clamp(48px, 9vw, 64px);
    line-height: 1.05;
    font-weight: 700;
    letter-spacing: -0.02em;
}

.h1-pinyin {
    display: block;
    margin-top: 14px;

    color: var(--accent);
    font-size: 22px;
    font-weight: 700;
    letter-spacing: 0;
}

.pinyin {
    margin: 8px 0 0;

    color: #94a3b8;
    font-size: 15px;
    font-weight: 500;
}

.hsk {
    display: inline-flex;
    margin: 12px 0 0;
    padding: 5px 14px;

    border-radius: 999px;
    background: var(--accent-bg);
    color: var(--accent-dark);

    font-size: 13px;
    font-weight: 700;
}

.translations-summary {
    margin: 18px 0 0;

    color: #111827;
    font-size: 17px;
    font-weight: 400;
}


/* =========================================================
   SIBLINGS NOTE
   ========================================================= */

.siblings-note {
    margin: 14px 0 0;
    text-align: center;
    font-size: 13px;
    color: #6b7280;
}

.siblings-label {
    display: block;
    margin-bottom: 4px;
    color: #94a3b8;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
}

.sibling-row {
    display: flex;
    align-items: baseline;
    justify-content: center;
    gap: 6px;
    margin-top: 4px;
}

.sibling-link {
    color: #111827;
    font-weight: 600;
    text-decoration: none;
}

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

.sibling-meaning {
    color: #94a3b8;
    font-size: 12px;
}


/* =========================================================
   MEANING SECTION
   ========================================================= */

.meaning-section h2 {
    margin: 0 0 18px;

    color: #111827;
    font-size: 20px;
    font-weight: 700;
}


/* =========================================================
   READING / MEANING ROWS
   ========================================================= */

.reading-block {
    padding-left: 0;
}

.reading-block + .reading-block {
    margin-top: 24px;
}

.reading-block h3 {
    margin: 0 0 12px;

    color: #111827;
    font-size: 18px;
    font-weight: 700;
}

.reading-block h3 span {
    margin-left: 8px;

    color: var(--accent);
    font-size: 15px;
    font-weight: 600;
}

.meaning-row {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 20px;
}

.meaning-row + .meaning-row {
    margin-top: 22px;
}

.meaning-content {
    flex: 1;
    min-width: 0;
    border-left: 3px solid #e5e7eb;
    padding-left: 16px;
}

.pos-line {
    display: flex;
    align-items: baseline;
    gap: 8px;
    margin: 0 0 6px;
}

.pos-tag {
    color: #111827;
    font-size: 17px;
    font-weight: 700;
}

.pos-pinyin {
    color: #6b7280;
    font-size: 13px;
    font-weight: 400;
}

.pos-label {
    color: #94a3b8;
    font-size: 15px;
    font-weight: 400;
}

.translation {
    margin: 0 0 10px;

    color: #111827;
    font-size: 16px;
    font-weight: 400;
}


/* =========================================================
   LEARN BUTTON
   ========================================================= */

.learn-btn {
    flex-shrink: 0;

    display: inline-flex;
    align-items: center;
    gap: 6px;

    padding: 7px 14px;
    margin-top: 2px;

    background: #1d6fbf;
    border: none;
    border-radius: 999px;
    color: #ffffff;

    font-size: 14px;
    font-weight: 600;
    font-family: inherit;
    line-height: 1.4;
    white-space: nowrap;
    cursor: pointer;

    transition: background 0.15s;
}

.learn-btn:hover {
    background: #1560a8;
}

.learn-btn-icon {
    font-size: 15px;
    font-weight: 700;
    line-height: 1;
}

.learn-btn-active {
    background: #16a34a;
}

.learn-btn-active:hover {
    background: #15803d;
}

.learn-btn:disabled {
    cursor: default;
    opacity: 0.85;
}

/* =========================================================
   LEARN POPUP
   ========================================================= */

.learn-popup-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.4);
    z-index: 1000;
    align-items: center;
    justify-content: center;
}

.learn-popup-overlay.is-open {
    display: flex;
}

.learn-popup {
    background: #ffffff;
    border-radius: 20px;
    padding: 32px 28px;
    width: 100%;
    max-width: 320px;
    text-align: center;
    margin: 16px;
}

.learn-popup-icon {
    width: 52px;
    height: 52px;
    border-radius: 50%;
    background: #e6f1fb;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 16px;
}

.learn-popup-icon svg {
    width: 26px;
    height: 26px;
    stroke: #1d6fbf;
}

.learn-popup-title {
    margin: 0 0 8px;
    font-size: 18px;
    font-weight: 700;
    color: #111827;
}

.learn-popup-text {
    margin: 0 0 24px;
    font-size: 14px;
    color: #6b7280;
    line-height: 1.6;
}

.learn-popup-close {
    padding: 10px 28px;
    background: #111827;
    border: none;
    border-radius: 999px;
    color: #ffffff;
    font-size: 14px;
    font-weight: 600;
    font-family: inherit;
    cursor: pointer;
    transition: background 0.15s;
}

.learn-popup-close:hover {
    background: #1f2937;
}


/* =========================================================
   EXAMPLE SENTENCE
   ========================================================= */

.example {
    margin-top: 10px;
}

.zh-example {
    margin: 0;

    color: #111827;
    font-size: 16px;
    font-weight: 400;
}

.example-pinyin {
    margin: 4px 0 0;

    color: #6b7280;
    font-size: 14px;
    font-weight: 400;
}

.example-translation {
    margin: 4px 0 0;

    color: #6b7280;
    font-size: 14px;
    font-weight: 400;
}


/* =========================================================
   UNIFIED DISCLOSURE TRIANGLES
   ========================================================= */

details > summary {
    list-style: none;
    cursor: pointer;
}
details > summary::-webkit-details-marker {
    display: none;
}

.character-toggle > summary::before,
.character-words-toggle > summary::before,
.decomp-used-in-summary::before,
.decomp-show-more > summary::before,
.related-toggle-summary::before,
.related-more > summary::before,
.related-example-summary::before {
    content: "▶";
    display: inline-block;
    font-size: 9px;
    color: #94a3b8;
    margin-right: 4px;
    transition: transform 0.15s ease;
    vertical-align: middle;
}

.character-toggle[open] > summary::before,
.character-words-toggle[open] > summary::before,
.decomp-used-in-toggle[open] > .decomp-used-in-summary::before,
.decomp-show-more[open] > summary::before,
.related-toggle[open] > .related-toggle-summary::before,
.related-more[open] > summary::before,
.related-example[open] > .related-example-summary::before {
    transform: rotate(90deg);
    color: #374151;
}


/* =========================================================
   COLLAPSIBLE CHARACTER BREAKDOWN — button-style toggle
   ========================================================= */

.character-toggle {
    margin-top: 28px;
    padding-top: 24px;

    border-top: 1px solid #e5e7eb;
}

.character-toggle > summary {
    display: flex;
    align-items: center;
    justify-content: center;

    padding: 12px 16px;

    background: #ffffff;
    border: 1px solid #e5e7eb;
    border-radius: 12px;

    color: var(--accent);
    font-size: 15px;
    font-weight: 600;
}

.character-toggle > summary:hover {
    background: var(--accent-bg);
}

.character-breakdown-grid {
    display: flex;
    flex-direction: column;
    gap: 20px;
    margin-top: 16px;
}

.character-breakdown-grid .character-card {
    width: auto;
}


/* =========================================================
   CHARACTER CARDS
   Nested inside the breakdown toggle — indented with a
   left border to visually belong to the parent word.
   ========================================================= */

.character-card {
    padding: 20px;

    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 16px;
}

/* Nested breakdown cards look like tabs inside the word */
.character-breakdown-grid .character-card {
    margin-left: 12px;
    border-left: 3px solid #e5e7eb;
    border-radius: 0 16px 16px 0;
}

.character-card h3 {
    display: flex;
    align-items: baseline;
    flex-wrap: wrap;
    gap: 8px 10px;

    margin: 0 0 14px;
}

.character-card h3 a {
    color: #111827;
    font-size: 36px;
    font-weight: 700;
    text-decoration: none;
}

.char-pinyin {
    color: var(--accent);
    font-size: 16px;
    font-weight: 600;
}

.char-translation-inline {
    color: #6b7280;
    font-size: 15px;
    font-weight: 400;
}


/* =========================================================
   STROKE ORDER / WRITING
   ========================================================= */

.writing {
    margin: 0 0 14px;
    padding: 12px;

    background: #ffffff;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    text-align: center;
}

.writing-label {
    margin: 0 0 8px;

    color: #94a3b8;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.writing img {
    max-width: 100%;
    height: auto;
}

.hanzi-writer-container {
    position: relative;
    display: inline-block;
    width: 100px;
    height: 100px;
    border: 1px solid #e5e7eb;
    border-radius: 4px;
    background: #ffffff;
}

.hanzi-writer-grid {
    position: absolute;
    top: 0;
    left: 0;
    width: 100px;
    height: 100px;
    pointer-events: none;
}

.hanzi-writer-target {
    position: absolute;
    top: 0;
    left: 0;
    width: 100px;
    height: 100px;
}

.hanzi-play-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 4px;

    margin: 8px auto 0;
    padding: 4px 16px;

    border: 1px solid #e5e7eb;
    border-radius: 999px;
    background: #f8fafc;

    font-size: 12px;
    font-weight: 500;
    color: #6b7280;
    cursor: pointer;
    transition: background 0.15s, border-color 0.15s, color 0.15s;
}

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


/* =========================================================
   DECOMPOSITION CHIPS (legacy)
   ========================================================= */

.decomposition {
    margin-top: 14px;
    padding: 14px;

    background: #ffffff;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
}

.decomposition h4 {
    margin: 0 0 10px;

    color: #94a3b8;
    font-size: 13px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.decomposition ul {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;

    margin: 0;
    padding: 0;
    list-style: none;
}

.decomposition li {
    display: inline-flex;
    align-items: baseline;
    gap: 4px;

    padding: 6px 10px;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 999px;

    color: #6b7280;
    font-size: 13px;
}

.decomposition li a {
    color: #111827;
    font-size: 16px;
    font-weight: 700;
}


/* =========================================================
   DECOMPOSITION SECTION — two-direction structure
   ========================================================= */

.decomp-used-in-heading {
    margin: 0 0 12px;
    color: #111827;
    font-size: 15px;
    font-weight: 600;
}

.decomp-direction {
    margin-top: 4px;
}

.decomp-not-component {
    margin: 0;
    color: #94a3b8;
    font-size: 13px;
    font-style: italic;
}

.decomp-atomic-note {
    margin: 8px 0 0;
    color: #94a3b8;
    font-size: 13px;
    font-style: italic;
}

.decomp-top-row {
    display: flex;
    align-items: baseline;
    gap: 8px;
}

.decomp-number {
    font-size: 13px;
    font-weight: 700;
    color: #94a3b8;
    flex-shrink: 0;
}

.decomp-top-glyph {
    font-size: 26px;
    font-weight: 700;
    color: #111827;
    text-decoration: none;
}

.decomp-top-glyph:hover {
    color: var(--accent);
}

.decomp-top-pinyin {
    font-size: 13px;
    color: var(--accent);
    font-weight: 500;
}

.decomp-top-meaning {
    font-size: 13px;
    color: #6b7280;
}

.decomp-badges-row {
    display: flex;
    gap: 6px;
    margin: 4px 0 0 21px;
}

.decomp-source-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;

    width: 18px;
    height: 18px;
    border-radius: 50%;
    flex-shrink: 0;
}

.decomp-source-icon-character {
    background: var(--accent-bg);
    color: var(--accent-dark);
}

.decomp-source-icon-component {
    background: #f1f5f9;
    color: #64748b;
}

.decomp-polyphonic-pill {
    display: inline-flex;
    align-items: center;

    padding: 2px 9px;
    border-radius: 999px;

    background: #fef3c7;
    color: #92400e;

    font-size: 10px;
    font-weight: 700;
    letter-spacing: 0.02em;
}

.decomp-used-in-toggle {
    margin: 10px 0 0 21px;
}

.decomp-used-in-summary {
    display: flex;
    align-items: center;
    gap: 5px;

    list-style: none;

    color: #6b7280;
    font-size: 13px;
}

.decomp-used-in-toggle[open] > .decomp-used-in-summary {
    color: var(--accent);
    font-weight: 500;
}

.decomp-used-in-body {
    margin-top: 8px;
}

.decomp-hsk-row {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    margin-bottom: 6px;
}

.decomp-hsk-label {
    min-width: 46px;
    padding-top: 6px;

    color: #94a3b8;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    white-space: nowrap;
    flex-shrink: 0;
}

.decomp-tiles {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.decomp-tile {
    display: inline-flex;
    flex-direction: column;
    align-items: center;

    width: 92px;
    box-sizing: border-box;
    padding: 6px 8px;

    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 10px;

    text-decoration: none;
    color: inherit;
    transition: background 0.15s, border-color 0.15s;
}

.decomp-tile:hover {
    background: var(--accent-bg);
    border-color: var(--accent-border);
}

.decomp-tile-glyph {
    font-size: 18px;
    font-weight: 700;
    color: #111827;
    line-height: 1.2;
}

.decomp-tile-pinyin {
    font-size: 10px;
    color: var(--accent);
    margin-top: 1px;
}

.decomp-tile-meaning {
    font-size: 10px;
    color: #6b7280;
    margin-top: 1px;
    text-align: center;
    width: 100%;
    word-break: break-word;
    white-space: normal;
    line-height: 1.3;
}

.decomp-show-more {
    margin: 4px 0 8px 54px;
}

.decomp-show-more > summary {
    display: inline-flex;
    align-items: center;
    color: var(--accent);
    font-size: 12px;
    font-weight: 500;
    list-style: none;
}

.decomp-show-more[open] > summary {
    margin-bottom: 6px;
}

.decomp-consists-of-label {
    margin: 14px 0 8px;
    color: #94a3b8;
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.decomp-parts {
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.decomp-part {
    display: flex;
    flex-direction: column;
    gap: 0;

    padding-left: 12px;
    border-left: 2px solid #e5e7eb;
}

.decomp-sub-row {
    gap: 6px;
}

.decomp-sub-glyph {
    font-size: 18px;
    font-weight: 700;
    color: #111827;
    text-decoration: none;
}

.decomp-sub-glyph:hover {
    color: var(--accent);
}

.decomp-sub-pinyin {
    font-size: 12px;
    color: var(--accent);
    font-weight: 500;
}

.decomp-sub-meaning {
    font-size: 12px;
    color: #6b7280;
}

.decomp-part .decomp-badges-row,
.decomp-part .decomp-used-in-toggle {
    margin-left: 17px;
}


/* =========================================================
   RELATED WORDS
   ========================================================= */

.related-toggle {
    margin-top: 14px;
    padding-top: 14px;
    border-top: 1px solid #e5e7eb;
}

.related-toggle-summary {
    display: flex;
    align-items: center;
    gap: 5px;

    list-style: none;

    color: #94a3b8;
    font-size: 13px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.related-toggle[open] > .related-toggle-summary {
    color: var(--accent);
}

.related {
    margin-top: 12px;
}

.related ul {
    display: flex;
    flex-direction: column;
    gap: 14px;

    margin: 0;
    padding: 0;
    list-style: none;
}

.related li {
    margin: 0;
    padding-left: 12px;
    border-left: 2px solid #e5e7eb;
}

.related-word-row {
    display: flex;
    align-items: baseline;
    gap: 8px;
}

.related-number {
    font-size: 13px;
    font-weight: 700;
    color: #94a3b8;
    flex-shrink: 0;
}

.related a {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    gap: 6px;

    color: inherit;
    text-decoration: none;
}

.related a:hover .related-word-glyph {
    color: var(--accent);
}

.char-context-hint {
    margin: 4px 0 0;

    color: #94a3b8;
    font-size: 12px;
    font-style: italic;
}

.char-context-full {
    display: flex;
    flex-direction: column;
    gap: 3px;

    margin: 6px 0 0 48px;
    padding: 0;

    list-style: none;
}

.char-context-full li {
    display: flex;
    align-items: baseline;
    gap: 6px;

    padding: 0;
    border: none;

    color: #6b7280;
    font-size: 12.5px;
}

.char-context-glyph {
    min-width: 16px;

    color: #374151;
    font-weight: 700;
    text-decoration: none;
}

.char-context-glyph:hover {
    color: var(--accent);
    text-decoration: underline;
}

.char-context-meaning {
    color: #6b7280;
}

.related-word-glyph {
    font-size: 18px;
    font-weight: 700;
    color: #111827;
    transition: color 0.15s;
}

.related span {
    font-size: 13px;
}

.related .related-word-pinyin {
    color: var(--accent);
    font-weight: 500;
}

.related .related-word-meaning {
    color: #6b7280;
}

.related small {
    margin-left: auto;

    color: #94a3b8;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.related-example {
    margin-top: 6px;
    margin-left: 48px;
}

.related-example-summary {
    display: flex;
    align-items: center;
    gap: 5px;

    list-style: none;

    color: #94a3b8;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.related-example[open] > .related-example-summary {
    color: var(--accent);
}

.related-example-body {
    margin-top: 6px;
    padding-left: 10px;
    border-left: 2px solid #e5e7eb;
    display: flex;
    flex-direction: column;
    gap: 3px;
}

.related-example-chinese {
    margin: 0;
    font-size: 14px;
    font-weight: 500;
    color: #111827;
}

.related-example-pinyin {
    margin: 0;
    font-size: 12px;
    color: var(--accent);
}

.related-example-translation {
    margin: 0;
    font-size: 12px;
    color: #6b7280;
}

.related-more {
    margin-top: 10px;
}

.related-more > summary {
    display: flex;
    align-items: center;
    gap: 5px;

    list-style: none;

    color: #6b7280;
    font-size: 13px;
}

.related-more[open] > summary {
    color: var(--accent);
    font-weight: 500;
}

.related-more ul {
    margin-top: 10px;
}


/* =========================================================
   USER-DEFINED TRANSLATIONS ("My translations")
   Nested inside .meaning-content, right after .example —
   not a standalone top-level section, so spacing is lighter
   than a full section break.
   ========================================================= */

.user-customizations {
    margin-top: 14px;
}

.customizations-guard {
    padding: 14px;

    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 12px;

    color: #94a3b8;
    font-size: 14px;
    text-align: center;
}

.customizations-guard p {
    margin: 0;
}

.customizations-list {
    list-style: none;
    padding: 0;
    margin: 0 0 12px;

    display: flex;
    flex-direction: column;
    gap: 22px;
}

.customization-item {
    padding-top: 4px;
}

.customization-view {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 20px;
}

.customization-content {
    flex: 1;
    min-width: 0;
    border-left: 3px solid #4338ca;
    padding-left: 16px;
}

.ud-badge {
    display: inline-flex;
    align-items: center;

    padding: 2px 8px;
    border-radius: 999px;

    background: #eef2ff;
    color: #4338ca;

    font-size: 10px;
    font-weight: 700;
    letter-spacing: 0.04em;
}

.customization-pos-line .pos-tag {
    margin-left: 8px;
}

.customization-item-actions {
    display: flex;
    gap: 14px;
    margin-top: 8px;
}

.customization-edit-btn,
.customization-delete-btn {
    padding: 0;

    background: none;
    border: none;

    font-size: 12px;
    font-weight: 500;
    font-family: inherit;
    cursor: pointer;
    transition: color 0.15s;
}

.customization-edit-btn {
    color: #6b7280;
}

.customization-edit-btn:hover {
    color: var(--accent);
    text-decoration: underline;
}

.customization-delete-btn {
    color: #9ca3af;
}

.customization-delete-btn:hover {
    color: #991b1b;
    text-decoration: underline;
}

.customization-delete-btn--confirm {
    color: #991b1b;
    font-weight: 700;
    text-decoration: underline;
}

/* Collapsed state: single pill button — reuses .learn-btn's blue
   styling via the shared class applied in the HTML; only need to
   handle its hidden state here. */
.customization-add-btn[hidden] {
    display: none;
}

/* Expanded state: the actual add-form, and the per-item edit form —
   both share identical container/input/textarea/action styling. */
.customization-form,
.customization-edit-form {
    margin-top: 10px;
    padding: 16px;

    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
}

.customization-form[hidden],
.customization-edit-form[hidden] {
    display: none;
}

.customization-form input,
.customization-form textarea,
.customization-edit-form input,
.customization-edit-form textarea {
    width: 100%;
    box-sizing: border-box;

    padding: 9px 12px;
    margin-bottom: 8px;

    background: #ffffff;
    border: 1px solid #e5e7eb;
    border-radius: 8px;

    font-family: inherit;
    font-size: 14px;
    color: #111827;
    resize: none;
}

.customization-form input:focus,
.customization-form textarea:focus,
.customization-edit-form input:focus,
.customization-edit-form textarea:focus {
    outline: none;
    border-color: var(--accent);
}

.customization-form input::placeholder,
.customization-form textarea::placeholder,
.customization-edit-form input::placeholder,
.customization-edit-form textarea::placeholder {
    color: #94a3b8;
}

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

#add-customization-btn,
.customization-save-btn {
    padding: 9px 20px;

    background: var(--accent-dark);
    border: none;
    border-radius: 999px;

    color: #ffffff;
    font-size: 14px;
    font-weight: 600;
    font-family: inherit;
    cursor: pointer;

    transition: background 0.15s;
}

#add-customization-btn:hover,
.customization-save-btn:hover {
    background: var(--accent);
}

.customization-cancel-btn {
    padding: 9px 18px;

    background: none;
    border: 1px solid #e5e7eb;
    border-radius: 999px;

    color: #6b7280;
    font-size: 14px;
    font-weight: 500;
    font-family: inherit;
    cursor: pointer;

    transition: background 0.15s;
}

.customization-cancel-btn:hover {
    background: #f1f5f9;
}

.customization-feedback {
    margin: 10px 0 0;
    font-size: 13px;
}

.customization-feedback--success {
    color: #166534;
}

.customization-feedback--error {
    color: #991b1b;
}


/* =========================================================
   MOBILE RESPONSIVE RULES
   ========================================================= */

@media (max-width: 700px) {

    html, body {
        overflow-x: hidden;
    }

    .word-page {
        padding: 0;
        width: 100%;
        max-width: 100vw;
        overflow-x: hidden;
    }

    .word-entry {
        width: 100%;
        overflow-x: hidden;
    }

    .card {
        border-left: none;
        border-right: none;
        border-radius: 0;
        padding: 16px;
        width: 100%;
        box-sizing: border-box;
        overflow: hidden;
    }

    .card-divider {
        margin: 18px 0;
    }

    .meaning-section {
        overflow: hidden;
    }

    .character-toggle {
        margin: 0;
        padding: 0;
        border-top: 1px solid #e5e7eb;
    }

    .character-toggle > summary {
        border: none;
        border-bottom: 1px solid #e5e7eb;
        border-radius: 0;
        background: #f9fafb;
        padding: 12px 16px;
        box-sizing: border-box;
    }

    .character-breakdown-grid {
        display: block;
        width: 100%;
        margin: 0;
        padding: 0;
        overflow: hidden;
    }

    .character-breakdown-grid .character-card,
    .character-card {
        display: block;
        margin: 0 !important;
        padding: 16px !important;
        border: none !important;
        border-top: 1px solid #e5e7eb !important;
        border-radius: 0 !important;
        background: #f9fafb !important;
        width: 100% !important;
        box-sizing: border-box !important;
    }

    .word-hero h1 {
        font-size: 44px;
    }

    .h1-pinyin {
        font-size: 19px;
    }

    .meaning-section h2 {
        font-size: 18px;
    }

    .meaning-row + .meaning-row {
        margin-top: 18px;
    }

    .zh-example {
        font-size: 16px;
    }

    .learn-btn {
        padding: 6px 11px;
        font-size: 13px;
    }

    .related-word-row {
        flex-wrap: wrap;
    }

    .related small {
        margin-left: 0;
        width: 100%;
    }

    .related ul {
        gap: 18px;
    }

    .related-word-glyph {
        font-size: 16px;
    }

    .char-context-full {
        margin-left: 24px;
    }

    .related-example {
        margin-left: 24px;
    }
}


/* =========================================================
   RTL SUPPORT (Arabic)
   ========================================================= */

[dir="rtl"] .meaning-content {
    border-left: none;
    border-right: 3px solid #e5e7eb;
    padding-left: 0;
    padding-right: 16px;
}

[dir="rtl"] .meaning-row {
    flex-direction: row-reverse;
}

[dir="rtl"] .related li {
    padding-left: 0;
    padding-right: 12px;
    border-left: none;
    border-right: 2px solid #e5e7eb;
}

[dir="rtl"] .related-word-row {
    flex-direction: row-reverse;
}

[dir="rtl"] .char-context-full {
    margin-left: 0;
    margin-right: 48px;
}

[dir="rtl"] .related-example {
    margin-left: 0;
    margin-right: 24px;
}

[dir="rtl"] .related-example-body {
    padding-left: 0;
    padding-right: 10px;
    border-left: none;
    border-right: 2px solid #e5e7eb;
}

[dir="rtl"] .decomp-part {
    padding-left: 0;
    padding-right: 12px;
    border-left: none;
    border-right: 2px solid #e5e7eb;
}

[dir="rtl"] .decomp-top-row {
    flex-direction: row-reverse;
}

[dir="rtl"] .decomp-badges-row {
    margin-left: 0;
    margin-right: 21px;
}

[dir="rtl"] .decomp-used-in-toggle {
    margin-left: 0;
    margin-right: 21px;
}

[dir="rtl"] .decomp-show-more {
    margin-left: 0;
    margin-right: 54px;
}

[dir="rtl"] .pos-line {
    flex-direction: row-reverse;
}

[dir="rtl"] .siblings-note {
    direction: rtl;
}

[dir="rtl"] .character-breakdown-grid .character-card {
    margin-left: 0;
    margin-right: 12px;
    border-left: none;
    border-right: 3px solid #e5e7eb;
    border-radius: 16px 0 0 16px;
}

[dir="rtl"] .customization-view {
    flex-direction: row-reverse;
}

[dir="rtl"] .customization-content {
    border-left: none;
    border-right: 3px solid #4338ca;
    padding-left: 0;
    padding-right: 16px;
}
.customization-form select,
.customization-edit-form select {
    width: 100%;
    box-sizing: border-box;

    padding: 9px 12px;
    margin-bottom: 8px;

    background: #ffffff;
    border: 1px solid #e5e7eb;
    border-radius: 8px;

    font-family: inherit;
    font-size: 14px;
    color: #94a3b8;
}

.customization-form select.pos-selected,
.customization-edit-form select.pos-selected {
    color: #111827;
}

.customization-form select:focus,
.customization-edit-form select:focus {
    outline: none;
    border-color: var(--accent);
}
.customization-pos-tag {
    display: inline-block;
    margin-bottom: 4px;

    color: #111827;
    font-size: 15px;
    font-weight: 700;
}

/* =========================================================
   REPORT LINK
   ========================================================= */

.report-link {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 0;
    background: none;
    border: none;
    color: #9ca3af;
    font-size: 12px;
    font-family: inherit;
    cursor: pointer;
    white-space: nowrap;
    flex-shrink: 0;
    transition: color 0.15s;
}

.report-link:hover {
    color: #6b7280;
}