/* Sound chart. The table shape follows ThePureLanguage's pinyinchart.css (bordered, fixed layout, header shades,
   hover lift); the voiceless/voiced colours and the vowel tiles are this site's own. */

.sc-table {
    table-layout: fixed;
    min-width: 640px;
    font-size: 0.85rem;
}

.sc-table th,
.sc-table td {
    text-align: center;
    vertical-align: middle;
    padding: 0.35rem 0.2rem;
}

.sc-head {
    font-size: 0.72rem;
    font-weight: 600;
    line-height: 1.2;
}

.sc-corner { width: 6.5rem; }

.sc-row-head {
    background-color: var(--bs-tertiary-bg);
    font-size: 0.75rem;
    font-weight: 600;
    text-align: left !important;
}

.sc-empty { background-color: var(--bs-tertiary-bg); }

.sc-cell {
    white-space: nowrap;
}

.sc-sound {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 2.4rem;
    min-height: 2.4rem;
    margin: 0.1rem;
    padding: 0.15rem 0.35rem;
    border-radius: 0.45rem;
    border: 2px solid transparent;
    font-size: 1.15rem;
    font-weight: 700;
    text-decoration: none;
    transition: transform 0.12s, box-shadow 0.12s, background-color 0.12s;
}

.sc-sound:hover,
.sc-sound:focus-visible {
    transform: scale(1.06);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

.sc-voiceless { background: #e7f1ff; color: #084298; }
.sc-voiced { background: #fff3cd; color: #664d03; }
.sc-vowel { background: #d1e7dd; color: #0a3622; flex-direction: column; min-width: 4.2rem; padding: 0.3rem 0.5rem; }
.sc-vowel-symbol { font-size: 1.2rem; line-height: 1.1; }
.sc-vowel-word { font-size: 0.72rem; font-weight: 500; }

.sc-sound.is-selected { border-color: #0d6efd; }

.sc-key {
    display: inline-block;
    width: 0.9rem;
    height: 0.9rem;
    border-radius: 0.2rem;
    vertical-align: -0.1rem;
    margin-right: 0.25rem;
}
.sc-key-voiceless { background: #e7f1ff; border: 1px solid #9ec5fe; }
.sc-key-voiced { background: #fff3cd; border: 1px solid #ffe69c; }

.sc-card-symbol {
    font-size: 1.2rem;
    color: #0d6efd;
    margin-right: 0.25rem;
}

.sc-example {
    font-size: 1.1rem;
    min-width: 6.5rem;
}

.sc-example mark {
    padding: 0 0.05em;
    background: #ffe69c;
    color: inherit;
    border-radius: 0.15rem;
    font-weight: 700;
}

[data-bs-theme="dark"] .sc-voiceless { background: #031633; color: #9ec5fe; }
[data-bs-theme="dark"] .sc-voiced { background: #332701; color: #ffda6a; }
[data-bs-theme="dark"] .sc-vowel { background: #051b11; color: #a3cfbb; }
[data-bs-theme="dark"] .sc-key-voiceless { background: #031633; border-color: #084298; }
[data-bs-theme="dark"] .sc-key-voiced { background: #332701; border-color: #997404; }
[data-bs-theme="dark"] .sc-card-symbol { color: #6ea8fe; }
[data-bs-theme="dark"] .sc-example mark { background: #664d03; }

@media (prefers-reduced-motion: reduce) {
    .sc-sound { transition: none; }
    .sc-sound:hover, .sc-sound:focus-visible { transform: none; }
}

/* Mouth diagrams (Models/MouthDiagram.cs). Colours are custom properties, never attributes: the face, nose cavity and
   upper teeth are <use> copies of the page's shared defs, and a [data-bs-theme] selector does not reach inside a <use>
   copy, but inherited properties do. */
.md-defs { position: absolute; width: 0; height: 0; overflow: hidden; }

.sc-mouth { text-align: center; }
.sc-mouth figcaption { text-align: left; margin-top: 0.25rem; }
.md-svg { display: block; width: 100%; max-width: 15rem; height: auto; margin: 0 auto; }

:root {
    --md-face: #f1d4bf; --md-air: #ffffff; --md-tissue: #e7b9a0; --md-tissue-line: #b98068;
    --md-tongue: #e8828a; --md-tongue-line: #b5525b; --md-ghost: #842029; --md-teeth: #ffffff; --md-teeth-line: #9a9a9a;
    --md-lip: #d78a7c; --md-lip-line: #ad6456; --md-voice: #fd7e14; --md-airflow: #198754;
    --md-place: rgba(13, 110, 253, 0.18); --md-place-line: #0d6efd; --md-peak: #842029; --md-peak-hole: #ffffff;
}
[data-bs-theme="dark"] {
    --md-face: #6b5446; --md-air: #1d2125; --md-tissue: #8a6656; --md-tissue-line: #b98068;
    --md-tongue: #c2606a; --md-tongue-line: #f1a3aa; --md-ghost: #ffe1e4; --md-teeth: #e9ecef; --md-teeth-line: #adb5bd;
    --md-lip: #b06e62; --md-lip-line: #d78a7c; --md-airflow: #75b798;
    --md-place: rgba(110, 168, 254, 0.2); --md-place-line: #6ea8fe; --md-peak: #f1a3aa; --md-peak-hole: #1d2125;
}

.md-face { fill: var(--md-face); }
.md-air { fill: var(--md-air); }
.md-tissue { fill: var(--md-tissue); stroke: var(--md-tissue-line); stroke-width: 0.6; }
.md-tongue { fill: var(--md-tongue); stroke: var(--md-tongue-line); stroke-width: 0.8; }
.md-ghost { fill: none; stroke: var(--md-ghost); stroke-width: 1; stroke-dasharray: 2.5 2; }
.md-teeth { fill: var(--md-teeth); stroke: var(--md-teeth-line); stroke-width: 0.7; }
.md-lip { fill: var(--md-lip); stroke: var(--md-lip-line); stroke-width: 0.6; }
.md-fold { fill: var(--md-tissue-line); }
.md-voice { fill: none; stroke: var(--md-voice); stroke-width: 1.2; stroke-linejoin: round; }
.md-airflow { fill: none; stroke: var(--md-airflow); stroke-width: 1.4; stroke-dasharray: 3 2.2; stroke-linecap: round; }
.md-arrow-head { fill: var(--md-airflow); }
.md-place { fill: var(--md-place); stroke: var(--md-place-line); stroke-width: 1.4; }
.md-peak { fill: var(--md-peak); }
.md-peak-start { fill: var(--md-peak-hole); stroke: var(--md-peak); stroke-width: 1; }
.md-glide { fill: none; stroke: var(--md-peak); stroke-width: 1.2; }
.md-glide-head { fill: var(--md-peak); }

.md-key { display: inline-block; width: 0.8rem; height: 0.8rem; margin-right: 0.25rem; vertical-align: -0.05rem; }
.md-key-place { border: 2px solid var(--md-place-line); border-radius: 50%; background: var(--md-place); }
.md-key-air { height: 0; border-top: 2px dashed var(--md-airflow); vertical-align: 0.2rem; }

#ipa-picker-buttons button {min-width:44px;min-height:44px;color:#1b5792;}[data-bs-theme=dark] #ipa-picker-buttons button {color:#afd5ff;}
#ipa-picker-buttons button:hover,#ipa-picker-buttons button:focus-visible {color:#fff;background:#1b5792;border-color:#1b5792;}
