/* KingDict: a clean, friendly, ad-free English dictionary. */

:root {
    --ink: #1f2937;
    --ink-soft: #4b5563;
    --muted: #6b7280;
    --line: #e5e7eb;
    --bg: #ffffff;
    --bg-soft: #f6f7fb;
    --brand: #2d3f9a;
    --brand-dark: #22307a;
    --brand-soft: #eef1fc;
    --headword: #b4232c;
    --uk: #d63c49;
    --uk-soft: #fdeef0;
    --us: #2668cf;
    --us-soft: #ebf2fd;
    --pos: #15803d;
    --signpost-bg: #fff1df;
    --signpost: #b45309;
    --register: #7e22ce;
    --geo: #1d4ed8;
    --example: #4b5563;
    --surface: #ffffff;
    --on-brand: #ffffff;
    --brand-soft-2: #dfe5fa;
    --brand-line: #c7cff2;
    --line-strong: #c7cbd6;
    --chip: #eceef3;
    --track: rgba(0, 0, 0, .08);
    --placeholder: #c4c9d4;
    --flash: #fff4c2;
    --hint-bg: #fff8eb;
    --danger: #b91c1c;
    --danger-soft: #fdecec;
    --ok: #166534;
    --ok-soft: #ecfdf3;
    --ok-line: #bfe8cd;
    --pos-faint: #9fd3b0;
    --amber: #a16207;
    --amber-soft: #fff8e1;
    --amber-line: #f5d98b;
    --etym: #8a6d00;
    --etym-bg: #fdf3c7;
    --row-selected: #f7f9ff;
    --row-playing: #fff6d6;
    --ring-rgb: 45 63 154;
    --shadow-rgb: 31 41 55;
    color-scheme: light;
    --radius: 12px;
    --font: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    --font-ipa: "Segoe UI", "Lucida Sans Unicode", "Arial Unicode MS", "DejaVu Sans", "Noto Sans", sans-serif;
    --speaker-icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M3 9h4l5.5-4.5v15L7 15H3z'/%3E%3Cpath d='M15.5 8.5a5 5 0 0 1 0 7M18.5 5.5a9.2 9.2 0 0 1 0 13' fill='none' stroke='black' stroke-width='2.2' stroke-linecap='round'/%3E%3C/svg%3E");
}

*, *::before, *::after {
    box-sizing: border-box;
}

html {
    -webkit-text-size-adjust: 100%;
    scroll-padding-top: 16px;
}

body {
    margin: 0;
    font-family: var(--font);
    font-size: 17px;
    line-height: 1.6;
    color: var(--ink);
    background: var(--bg);
}

a {
    color: inherit;
}

input, select, textarea {
    background-color: var(--surface);
    color: var(--ink);
}

h1:focus {
    outline: none;
}

kbd {
    font-family: inherit;
    font-size: .85em;
    border: 1px solid var(--line);
    border-bottom-width: 2px;
    border-radius: 4px;
    padding: 0 5px;
    background: var(--surface);
}

.muted {
    color: var(--muted);
}

.skip-link {
    position: absolute;
    left: -9999px;
    top: 8px;
    background: var(--surface);
    padding: 6px 12px;
    z-index: 100;
}

    .skip-link:focus {
        left: 8px;
    }

/* ---- Header ----------------------------------------------------------------------------------- */

.site-header {
    background: var(--surface);
    border-bottom: 1px solid var(--line);
}

.header-inner {
    max-width: 1160px;
    margin: 0 auto;
    padding: 14px 24px;
    display: flex;
    align-items: center;
    gap: 12px 32px;
    flex-wrap: wrap;
}

.logo {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    color: var(--brand);
    text-decoration: none;
    font-weight: 800;
    font-size: 24px;
    letter-spacing: -.3px;
}

.logo-mark {
    width: 34px;
    height: 34px;
}

.site-nav {
    margin-left: auto;
    display: flex;
    gap: 6px;
}

    .site-nav a {
        color: var(--ink-soft);
        text-decoration: none;
        font-size: 15px;
        font-weight: 600;
        padding: 6px 12px;
        border-radius: 999px;
    }

        .site-nav a:hover {
            background: var(--bg-soft);
            color: var(--ink);
        }

        .site-nav a.active {
            background: var(--brand-soft);
            color: var(--brand);
        }

/* Light / dark theme button: shows the moon in the light theme and the sun in the dark one. */
.theme-toggle {
    display: inline-grid;
    place-items: center;
    flex: none;
    width: 38px;
    height: 38px;
    padding: 0;
    border: 1px solid var(--line);
    border-radius: 50%;
    background: var(--surface);
    color: var(--ink-soft);
    cursor: pointer;
    transition: background .15s, color .15s, border-color .15s;
}

    .theme-toggle:hover {
        background: var(--brand-soft);
        border-color: var(--brand-line);
        color: var(--brand);
    }

    .theme-toggle:focus-visible {
        outline: none;
        box-shadow: 0 0 0 4px rgb(var(--ring-rgb) / .25);
    }

.theme-icon {
    width: 19px;
    height: 19px;
    fill: currentColor;
}

.theme-icon-sun {
    fill: none;
    stroke: currentColor;
    stroke-width: 2;
    stroke-linecap: round;
}

    .theme-icon-sun circle {
        fill: currentColor;
        stroke: none;
    }

.theme-icon-sun,
:root[data-theme="dark"] .theme-icon-moon {
    display: none;
}

:root[data-theme="dark"] .theme-icon-sun {
    display: block;
}

.theme-toggle-corner {
    position: fixed;
    top: 16px;
    right: 16px;
}

/* The crown in the logo uses the colour that reads on the brand colour. */
.logo-mark [fill="#fff"] {
    fill: var(--on-brand);
}

/* ---- Search box ------------------------------------------------------------------------------- */

.searchbox {
    position: relative;
    flex: 1 1 320px;
    max-width: 560px;
    display: flex;
    align-items: center;
    background: var(--bg-soft);
    border: 1px solid var(--line);
    border-radius: 999px;
    transition: box-shadow .15s, border-color .15s, background .15s;
}

    .searchbox:focus-within {
        background: var(--surface);
        border-color: var(--brand);
        box-shadow: 0 0 0 4px rgb(var(--ring-rgb) / .14);
    }

    .searchbox input {
        flex: 1;
        min-width: 0;
        border: 0;
        padding: 10px 6px 10px 20px;
        font: inherit;
        font-size: 16px;
        color: var(--ink);
        background: transparent;
        outline: none;
    }

        .searchbox input::-webkit-search-cancel-button {
            cursor: pointer;
        }

.search-btn {
    flex: none;
    display: grid;
    place-items: center;
    width: 38px;
    height: 38px;
    margin: 3px;
    border: 0;
    border-radius: 50%;
    background: var(--brand);
    color: var(--on-brand);
    cursor: pointer;
}

    .search-btn svg {
        width: 18px;
        height: 18px;
    }

    .search-btn:hover {
        background: var(--brand-dark);
    }

.searchbox-hero {
    max-width: 680px;
    margin: 0 auto;
    background: var(--surface);
    box-shadow: 0 8px 30px rgb(var(--shadow-rgb) / .10);
}

    .searchbox-hero input {
        padding: 16px 8px 16px 26px;
        font-size: 19px;
    }

    .searchbox-hero .search-btn {
        width: 50px;
        height: 50px;
        margin: 5px;
    }

        .searchbox-hero .search-btn svg {
            width: 22px;
            height: 22px;
        }

.suggest {
    position: absolute;
    top: calc(100% + 6px);
    left: 0;
    right: 0;
    margin: 0;
    padding: 6px;
    list-style: none;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: 14px;
    box-shadow: 0 12px 32px rgb(var(--shadow-rgb) / .16);
    z-index: 50;
    max-height: 70vh;
    overflow: auto;
    text-align: left;
}

    .suggest a {
        display: flex;
        justify-content: space-between;
        align-items: baseline;
        gap: 12px;
        padding: 7px 14px;
        border-radius: 8px;
        color: var(--ink);
        text-decoration: none;
    }

    .suggest li.active a, .suggest a:hover {
        background: var(--brand-soft);
    }

.tag {
    font-size: 12px;
    font-weight: 600;
    color: var(--pos);
    white-space: nowrap;
}

/* ---- Page frame ------------------------------------------------------------------------------- */

.site-main {
    max-width: 1160px;
    margin: 0 auto;
    padding: 36px 24px 64px;
    min-height: 65vh;
}

.site-footer {
    border-top: 1px solid var(--line);
    background: var(--bg-soft);
    color: var(--muted);
    font-size: 14px;
}

.footer-inner {
    max-width: 1160px;
    margin: 0 auto;
    padding: 20px 24px 28px;
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    gap: 6px 24px;
}

.page-columns {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 300px;
    gap: 56px;
    align-items: start;
}

.entry-column {
    max-width: 780px;
}

.side-column {
    position: sticky;
    top: 20px;
}

.pagetitle {
    font-size: 2rem;
    font-weight: 800;
    letter-spacing: -.5px;
    margin: 0 0 16px;
    line-height: 1.2;
}

.section-title {
    font-size: .8rem;
    font-weight: 700;
    color: var(--muted);
    text-transform: uppercase;
    letter-spacing: .08em;
    margin: 0 0 12px;
}

.see-all, .card-link {
    display: inline-block;
    margin-top: 10px;
    font-size: 15px;
    font-weight: 600;
    color: var(--brand);
    text-decoration: none;
}

    .see-all:hover, .card-link:hover {
        text-decoration: underline;
    }

/* ---- Audio buttons ---------------------------------------------------------------------------- */

.speaker {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    border: 0;
    background: none;
    margin: 0;
    padding: 0;
    font: inherit;
    line-height: 1;
    color: var(--muted);
    cursor: pointer;
    vertical-align: middle;
}

    .speaker::before {
        content: "";
        flex: none;
        width: 1.15em;
        height: 1.15em;
        background-color: currentColor;
        -webkit-mask: var(--speaker-icon) center / contain no-repeat;
        mask: var(--speaker-icon) center / contain no-repeat;
    }

    .speaker:focus-visible {
        outline: 2px solid var(--brand);
        outline-offset: 2px;
    }

    .speaker.playing::before {
        animation: kd-pulse .55s ease-in-out infinite alternate;
    }

    .speaker.audio-error {
        opacity: .35;
        cursor: not-allowed;
    }

    /* UK / US pills */
    .speaker.brefile, .speaker.amefile {
        padding: 5px 12px 5px 9px;
        border-radius: 999px;
        font-size: 14px;
        font-weight: 700;
        margin-right: 6px;
        transition: background .15s, transform .1s;
    }

    .speaker.brefile {
        color: var(--uk);
        background: var(--uk-soft);
    }

    .speaker.amefile {
        color: var(--us);
        background: var(--us-soft);
    }

        .speaker.brefile:hover, .speaker.amefile:hover {
            filter: brightness(.96) saturate(1.2);
        }

        .speaker.brefile:active, .speaker.amefile:active {
            transform: scale(.96);
        }

    .speaker .accent {
        letter-spacing: .03em;
    }

@keyframes kd-pulse {
    from { opacity: 1; }
    to { opacity: .3; }
}

.chip-uk, .chip-us {
    display: inline-block;
    font-weight: 700;
    font-size: .8em;
    padding: 0 7px;
    border-radius: 999px;
}

.chip-uk {
    color: var(--uk);
    background: var(--uk-soft);
}

.chip-us {
    color: var(--us);
    background: var(--us-soft);
}

/* ---- Entry: head ------------------------------------------------------------------------------ */

.form-of {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 6px 16px;
    background: var(--brand-soft);
    border-radius: 10px;
    padding: 10px 16px;
    margin: -4px 0 24px;
}

    .form-of a {
        color: var(--brand);
        font-weight: 700;
    }

    .form-of .form-of-go {
        margin-left: auto;
        text-decoration: none;
        font-size: 15px;
    }

        .form-of .form-of-go:hover {
            text-decoration: underline;
        }

.entry-jump {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin: -4px 0 28px;
}

    .entry-jump a {
        display: inline-flex;
        align-items: baseline;
        gap: 6px;
        padding: 4px 14px;
        border: 1px solid var(--line);
        border-radius: 999px;
        text-decoration: none;
        font-size: 15px;
    }

        .entry-jump a:hover {
            border-color: var(--brand);
            background: var(--brand-soft);
        }

.jump-word {
    font-weight: 700;
}

    .jump-word sup {
        font-size: .65em;
        margin-left: 1px;
    }

.jump-pos {
    color: var(--pos);
    font-size: 14px;
}

.ldoceEntry {
    display: block;
    padding-bottom: 32px;
    margin-bottom: 32px;
    border-bottom: 1px solid var(--line);
}

    .ldoceEntry:last-of-type {
        border-bottom: 0;
    }

.Head {
    display: block;
    margin-bottom: 18px;
}

.head-word {
    line-height: 1.2;
}

.HYPHENATION {
    color: var(--headword);
    font-size: 1.75rem;
    font-weight: 800;
}

.HOMNUM {
    color: var(--headword);
    font-weight: 700;
    font-size: .95rem;
    margin-left: 2px;
}

.head-pron {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 6px 4px;
    margin: 8px 0 4px;
}

    .head-pron .PronCodes {
        font-size: 1.05rem;
        color: var(--ink-soft);
        margin-right: 10px;
    }

.PronCodes, .PRON, .AMEVARPRON {
    font-family: var(--font-ipa);
}

.head-meta {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    gap: 4px 8px;
    margin-top: 6px;
    color: var(--ink-soft);
}

.LEVEL {
    color: var(--headword);
    letter-spacing: -1px;
    cursor: help;
}

.FREQ, .AC {
    display: inline-block;
    font-size: 12px;
    font-weight: 700;
    line-height: 1.6;
    padding: 0 7px;
    border-radius: 6px;
    color: var(--headword);
    background: var(--uk-soft);
    cursor: help;
}

.AC {
    color: var(--brand);
    background: var(--brand-soft);
}

.POS {
    color: var(--pos);
    font-weight: 700;
    font-style: italic;
}

.GRAM {
    color: var(--pos);
    font-weight: 400;
    margin-right: 4px;
}

.infllab {
    font-style: italic;
}

.Inflections .PronCodes {
    margin-left: .3em;
}

.inflform {
    font-weight: 700;
    color: var(--ink);
}

.REGISTERLAB {
    color: var(--register);
    font-style: italic;
}

.GEO {
    color: var(--geo);
    font-style: italic;
    margin: 0 .2em;
}

.LINKWORD {
    font-style: italic;
    color: var(--muted);
}

.LEXVAR, .ORTHVAR, .FULLFORM, .ABBR, .AMEQUIV, .BREQUIV, .DEFBOLD, .EXPR {
    font-weight: 700;
}

/* ---- Entry: senses ---------------------------------------------------------------------------- */

.Senses {
    display: block;
}

.Sense {
    display: block;
    position: relative;
    margin: 0 0 22px;
}

    .Sense.numbered {
        padding-left: 40px;
    }

    .Sense > .sensenum {
        position: absolute;
        left: 0;
        top: 1px;
        display: grid;
        place-items: center;
        width: 26px;
        height: 26px;
        border-radius: 50%;
        background: var(--brand);
        color: var(--on-brand);
        font-size: 13px;
        font-weight: 700;
    }

    .Sense:target, .PhrVbEntry:target {
        animation: kd-flash 2s ease-out;
    }

@keyframes kd-flash {
    from { background: var(--flash); }
    to { background: transparent; }
}

.Subsense {
    display: block;
    margin: 10px 0 0;
}

    .Subsense > .sensenum {
        font-weight: 700;
        color: var(--brand);
        margin-right: 6px;
    }

.SIGNPOST {
    display: inline-block;
    background: var(--signpost-bg);
    color: var(--signpost);
    font-size: 12px;
    font-weight: 700;
    line-height: 1.7;
    text-transform: uppercase;
    letter-spacing: .04em;
    border-radius: 6px;
    padding: 0 8px;
    margin-right: 6px;
    vertical-align: 1px;
}

.LEXUNIT {
    font-weight: 700;
}

.DEF {
    color: var(--ink);
}

.EXAMPLE {
    display: block;
    position: relative;
    color: var(--example);
    padding-left: 30px;
    margin: 6px 0;
    font-size: .96em;
}

    .EXAMPLE .speaker {
        position: absolute;
        left: 2px;
        top: .2em;
        width: 22px;
        height: 22px;
        justify-content: center;
        border-radius: 50%;
        color: var(--brand);
        background: var(--brand-soft);
        font-size: 12px;
    }

        .EXAMPLE .speaker:hover {
            background: var(--brand-soft-2);
        }

    .EXAMPLE.noaudio::before {
        content: "";
        position: absolute;
        left: 10px;
        top: .7em;
        width: 6px;
        height: 6px;
        border-radius: 50%;
        background: var(--line-strong);
    }

.COLLOINEXA {
    font-weight: 700;
    color: var(--ink);
}

.GLOSS {
    color: var(--brand);
    font-style: normal;
    margin-left: .25em;
}

.GramExa, .ColloExa {
    display: block;
    margin-top: 10px;
}

.PROPFORM, .PROPFORMPREP, .COLLO {
    display: block;
    font-weight: 700;
    color: var(--ink);
}

.SYN, .OPP {
    margin-left: 4px;
}

.synopp {
    display: inline-block;
    font-size: 11px;
    font-weight: 700;
    line-height: 1.6;
    color: var(--ink-soft);
    background: var(--chip);
    border-radius: 5px;
    padding: 0 6px;
    margin-right: 4px;
    vertical-align: 1px;
}

a.xref, a.Crossrefto {
    color: var(--brand);
    font-weight: 600;
    text-decoration: none;
}

    a.xref:hover, a.Crossrefto:hover, a.NonDV:hover {
        text-decoration: underline;
    }

a.NonDV {
    text-decoration: underline dotted var(--line-strong);
    text-underline-offset: 4px;
}

.RELATEDWD {
    margin-left: 6px;
}

.arrow {
    color: var(--muted);
}

.Crossref {
    display: block;
    margin: 8px 0;
}

.CROSSREFTYPE {
    font-style: italic;
    color: var(--muted);
}

.REFHOMNUM {
    font-size: .7em;
    vertical-align: super;
    line-height: 0;
}

.REFSENSENUM {
    font-weight: 400;
    color: var(--muted);
}

.Thesref {
    display: block;
    margin-top: 6px;
    font-size: .93em;
    color: var(--muted);
}

.Hint {
    display: block;
    background: var(--hint-bg);
    border-radius: 10px;
    padding: 10px 14px;
    margin: 10px 0;
}

.HINTBOLD {
    font-weight: 700;
}

.HINTITALIC {
    display: block;
    font-style: italic;
    color: var(--example);
}

.SpokenSect {
    display: block;
    margin-top: 28px;
}

.SpokenHead {
    display: block;
    font-size: .8rem;
    font-weight: 700;
    color: var(--muted);
    text-transform: uppercase;
    letter-spacing: .08em;
    padding-bottom: 6px;
    margin-bottom: 16px;
    border-bottom: 1px dashed var(--line);
}

.BOOKFILM {
    font-style: italic;
}

/* ---- Entry: tail and boxes -------------------------------------------------------------------- */

.Tail {
    display: block;
}

    .Tail > .Crossref {
        margin: 14px 0;
    }

.RunOn {
    display: block;
    margin: 14px 0 0;
}

    .RunOn .dash {
        color: var(--muted);
        margin-right: 6px;
    }

.DERIV {
    font-weight: 800;
    font-size: 1.05em;
    color: var(--ink);
}

.Box {
    --box-accent: var(--brand);
    --box-bg: #f7f8fd;
    --box-chip: #e4e8f8;
    display: block;
    background: var(--box-bg);
    border-radius: var(--radius);
    padding: 18px 22px;
    margin: 20px 0;
}

.ColloBox {
    --box-accent: #6d28d9;
    --box-bg: #f9f7ff;
    --box-chip: #ede7fd;
}

.ThesBox {
    --box-accent: #047857;
    --box-bg: #f2faf6;
    --box-chip: #d8f2e5;
}

.GramBox {
    --box-accent: #1d4ed8;
    --box-bg: #f3f7ff;
    --box-chip: #dde8fc;
}

.UsageBox, .F2NBox {
    --box-accent: #b45309;
    --box-bg: #fff9ef;
    --box-chip: #fde9c8;
}

.BoxHead {
    display: block;
    color: var(--box-accent);
    font-size: .8rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: .08em;
}

.BoxSub {
    display: block;
    font-weight: 700;
    margin-top: 2px;
}

.Section {
    display: block;
}

.SECHEADING {
    display: inline-block;
    background: var(--box-chip, var(--chip));
    color: var(--box-accent, var(--ink-soft));
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .05em;
    border-radius: 6px;
    padding: 1px 10px;
    margin: 18px 0 4px;
}

.Collocate, .Exponent {
    display: block;
    margin: 10px 0 0;
}

.COLLOC, .EXP {
    font-weight: 700;
}

.Exponent > .EXP {
    margin-right: .35em;
}

.COLLGLOSS {
    color: var(--muted);
    margin-left: 4px;
}

.COLLEXA, .THESEXA {
    display: block;
    position: relative;
    color: var(--example);
    padding-left: 16px;
    font-size: .95em;
}

    .COLLEXA::before, .THESEXA::before {
        content: "";
        position: absolute;
        left: 3px;
        top: .7em;
        width: 5px;
        height: 5px;
        border-radius: 50%;
        background: var(--box-accent, var(--muted));
        opacity: .6;
    }

.THESPROPFORM {
    display: block;
    font-weight: 700;
    padding-left: 16px;
}

.COLLORANGE {
    margin-left: 6px;
    color: var(--muted);
}

.ThesColloBox, .ErrorBox {
    display: block;
    margin-top: 10px;
}

.Error {
    display: block;
}

.BADCOLLO, .BADEXA {
    color: var(--danger);
    text-decoration: line-through;
    text-decoration-thickness: 1px;
}

.GOODCOLLO, .GOODEXA {
    color: var(--pos);
    font-weight: 700;
}

.GOODEXA {
    display: block;
}

.EXPL {
    display: block;
    margin-top: 8px;
}

    .EXPL.smiley::before {
        content: "✓ ";
        color: var(--pos);
        font-weight: 700;
    }

    .EXPL.frownie::before {
        content: "✗ ";
        color: var(--danger);
        font-weight: 700;
    }

.CROSS {
    color: var(--danger);
    font-weight: 700;
    margin: 0 3px 0 6px;
}

.CompareWord {
    display: block;
    margin-top: 12px;
}

    .CompareWord > .EXP {
        display: block;
        font-size: 1.05em;
    }

.Box .EXAMPLE {
    margin-left: 0;
}

.Gramref {
    display: none;
}

/* ---- Entry: phrasal verbs, verb table, origin -------------------------------------------------- */

.PhrVbs {
    display: block;
    margin-top: 32px;
}

.PhrVbEntry {
    display: block;
    padding: 16px 0 4px;
    border-top: 1px solid var(--line);
}

    .PhrVbEntry > .Head {
        margin: 0 0 10px;
    }

        .PhrVbEntry > .Head .POS {
            margin-left: 8px;
        }

.PHRVBHWD {
    color: var(--headword);
    font-weight: 800;
    font-size: 1.2em;
}

    .PHRVBHWD .OBJECT {
        color: var(--ink-soft);
        font-weight: 400;
        font-style: italic;
        font-size: .82em;
        margin-left: 6px;
    }

details.verb-table {
    margin: 0 0 20px;
}

    details.verb-table summary {
        display: inline-flex;
        align-items: center;
        gap: 6px;
        cursor: pointer;
        color: var(--brand);
        font-weight: 600;
        font-size: 15px;
        list-style: none;
        padding: 3px 12px;
        border: 1px solid var(--line);
        border-radius: 999px;
    }

        details.verb-table summary:hover {
            background: var(--brand-soft);
        }

        details.verb-table summary::-webkit-details-marker {
            display: none;
        }

        details.verb-table summary::before {
            content: "▸";
            font-size: 12px;
        }

    details.verb-table[open] summary::before {
        content: "▾";
    }

.verbtable {
    display: flex;
    flex-wrap: wrap;
    gap: 0 24px;
}

    .verbtable table {
        border-collapse: collapse;
        margin: 14px 0 0;
        flex: 1 1 320px;
        font-size: 15px;
    }

    .verbtable td {
        border-bottom: 1px solid var(--line);
        padding: 4px 8px;
        vertical-align: top;
    }

        .verbtable td.header {
            color: var(--brand);
            font-weight: 700;
            text-transform: uppercase;
            font-size: 12px;
            letter-spacing: .06em;
            border-bottom: 2px solid var(--brand-soft);
        }

        .verbtable td.col1 {
            font-weight: 600;
            width: 32%;
        }

        .verbtable td.col2 {
            color: var(--muted);
            width: 36%;
        }

    .verbtable .verb_form {
        font-weight: 700;
    }

    .verbtable .aux {
        color: var(--muted);
    }

.etym {
    display: block;
    margin-top: 24px;
    font-size: .95em;
    color: var(--ink-soft);
}

.etym-label {
    display: inline-block;
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .06em;
    color: var(--etym);
    background: var(--etym-bg);
    border-radius: 6px;
    padding: 0 8px;
    margin-right: 4px;
}

.etym-hwd {
    font-weight: 700;
    color: var(--ink);
}

.etym-sense.numbered {
    display: block;
    margin: 4px 0 0 18px;
}

    .etym-sense.numbered .sensenum {
        font-weight: 700;
        margin-right: 6px;
    }

.etym .ORIGIN {
    font-style: italic;
}

.etym-ref {
    font-variant: small-caps;
    color: var(--brand);
    text-decoration: none;
}

    .etym-ref:hover {
        text-decoration: underline;
    }

.source-note {
    font-size: 13px;
    color: var(--muted);
    margin-top: 8px;
}

/* ---- Sidebar ---------------------------------------------------------------------------------- */

.side-card {
    background: var(--bg-soft);
    border-radius: var(--radius);
    padding: 18px 20px;
    margin-bottom: 18px;
}

    .side-card h2 {
        font-size: .8rem;
        font-weight: 700;
        color: var(--muted);
        text-transform: uppercase;
        letter-spacing: .08em;
        margin: 0 0 10px;
    }

    .side-card ul {
        list-style: none;
        margin: 0;
        padding: 0;
    }

    .side-card li {
        padding: 3px 0;
        font-size: 15px;
    }

    .side-card a {
        color: var(--brand);
        text-decoration: none;
    }

        .side-card a:hover {
            text-decoration: underline;
        }

.cn-sense {
    line-height: 1.8;
}

/* ---- Home ------------------------------------------------------------------------------------- */

.hero {
    text-align: center;
    padding: 52px 24px 44px;
    margin: 0 0 36px;
    border-radius: 24px;
    background: linear-gradient(180deg, var(--brand-soft) 0%, var(--bg-soft) 100%);
}

    .hero h1 {
        font-size: clamp(1.8rem, 4vw, 2.6rem);
        font-weight: 800;
        letter-spacing: -.8px;
        margin: 0 0 10px;
        line-height: 1.15;
    }

.hero-sub {
    max-width: 640px;
    margin: 0 auto 28px;
    color: var(--ink-soft);
}

.hero-try {
    margin: 18px 0 0;
    color: var(--muted);
    font-size: 15px;
}

    .hero-try a {
        color: var(--brand);
        font-weight: 600;
        text-decoration: none;
        margin-left: 10px;
    }

        .hero-try a:hover {
            text-decoration: underline;
        }

.home-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 24px;
}

.card {
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 22px 24px;
    background: var(--surface);
}

.card-label {
    display: block;
    font-size: .8rem;
    font-weight: 700;
    color: var(--muted);
    text-transform: uppercase;
    letter-spacing: .08em;
    margin-bottom: 12px;
}

.wotd .card-label {
    color: var(--headword);
}

.wotd-head {
    display: flex;
    align-items: baseline;
    flex-wrap: wrap;
    gap: 4px 10px;
}

.wotd-word {
    font-size: 2rem;
    font-weight: 800;
    color: var(--headword);
    text-decoration: none;
    letter-spacing: -.5px;
}

    .wotd-word:hover {
        text-decoration: underline;
    }

.wotd-audio {
    margin: 10px 0 4px;
}

.wotd-def {
    margin: 10px 0 0;
    color: var(--ink-soft);
}

.word-cloud {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

    .word-cloud a {
        padding: 3px 12px;
        border-radius: 999px;
        background: var(--bg-soft);
        color: var(--ink);
        text-decoration: none;
        font-size: 15px;
    }

        .word-cloud a:hover {
            background: var(--brand-soft);
            color: var(--brand);
        }

.letters {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

    .letters a, .letters .current {
        display: inline-grid;
        place-items: center;
        min-width: 36px;
        height: 36px;
        padding: 0 8px;
        border-radius: 10px;
        background: var(--bg-soft);
        text-decoration: none;
        font-weight: 700;
        text-transform: uppercase;
        font-size: 15px;
    }

        .letters a:hover {
            background: var(--brand-soft);
            color: var(--brand);
        }

    .letters .current {
        background: var(--brand);
        color: var(--on-brand);
    }

.letters-wide {
    margin-bottom: 20px;
}

/* ---- Lists: search, browse, word lists -------------------------------------------------------- */

.result-columns {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 40px;
}

.result-list, .suggestion-list {
    list-style: none;
    margin: 0;
    padding: 0;
}

    .result-list li, .suggestion-list li {
        padding: 4px 0;
    }

    .result-list a, .suggestion-list a {
        color: var(--brand);
        font-weight: 600;
        text-decoration: none;
    }

        .result-list a:hover, .suggestion-list a:hover {
            text-decoration: underline;
        }

    .result-list .tag {
        margin-left: 8px;
    }

.did-you-mean {
    background: var(--bg-soft);
    border-radius: 10px;
    padding: 10px 16px;
}

    .did-you-mean a {
        font-weight: 700;
        color: var(--brand);
        margin-left: 10px;
    }

.browse-list {
    list-style: none;
    margin: 0 0 24px;
    padding: 0;
    columns: 4 190px;
    column-gap: 28px;
}

    .browse-list li {
        padding: 2px 0;
        break-inside: avoid;
    }

    .browse-list a {
        text-decoration: none;
    }

        .browse-list a:hover {
            color: var(--brand);
            text-decoration: underline;
        }

.pager {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    align-items: center;
    margin-top: 24px;
}

    .pager a, .pager .current, .pager .gap {
        min-width: 36px;
        text-align: center;
        padding: 5px 12px;
        border-radius: 10px;
        text-decoration: none;
        font-size: 15px;
        background: var(--bg-soft);
    }

    .pager a:hover {
        background: var(--brand-soft);
        color: var(--brand);
    }

    .pager .current {
        background: var(--brand);
        color: var(--on-brand);
    }

    .pager .gap {
        background: none;
    }

.book-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 16px;
}

.book-card {
    display: flex;
    flex-direction: column;
    gap: 2px;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 16px 18px;
    text-decoration: none;
    transition: border-color .15s, box-shadow .15s;
}

    .book-card:hover {
        border-color: var(--brand);
        box-shadow: 0 6px 18px rgb(var(--ring-rgb) / .10);
    }

.book-name {
    font-weight: 700;
    color: var(--ink);
}

.book-name-cn {
    color: var(--muted);
    font-size: .9rem;
    font-weight: 400;
}

.book-count {
    font-size: 14px;
    color: var(--brand);
    font-weight: 600;
}

.book-desc {
    margin-top: 6px;
    font-size: 14px;
    line-height: 1.5;
    color: var(--ink-soft);
}

.book-meta {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 6px 10px;
    margin-top: auto;
    padding-top: 10px;
}

.book-level {
    display: inline-block;
    font-size: 12px;
    font-weight: 600;
    color: var(--ink-soft);
    background: var(--bg-soft);
    border: 1px solid var(--line);
    border-radius: 999px;
    padding: 0 9px;
}

.book-filter {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 10px 16px;
    margin: 8px 0 24px;
}

.book-section {
    margin-bottom: 32px;
}

.book-credits {
    font-size: 13px;
    margin-top: 8px;
}

    .book-credits a, .book-source a {
        color: var(--brand);
    }

.book-facts {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 6px 14px;
    margin: 0;
    color: var(--muted);
    font-size: 15px;
}

.book-description {
    max-width: 760px;
    color: var(--ink-soft);
    margin: 4px 0 8px;
}

.book-unit {
    display: block;
    font-size: 12px;
    color: var(--muted);
}

.breadcrumb {
    margin: 0 0 6px;
    font-size: 15px;
}

    .breadcrumb a {
        color: var(--brand);
        text-decoration: none;
    }

.word-table {
    width: 100%;
    border-collapse: collapse;
}

    .word-table th {
        text-align: left;
        font-size: 12px;
        text-transform: uppercase;
        letter-spacing: .06em;
        color: var(--muted);
        border-bottom: 2px solid var(--line);
        padding: 8px;
    }

    .word-table td {
        border-bottom: 1px solid var(--line);
        padding: 12px 8px;
        vertical-align: top;
    }

    .word-table .num {
        color: var(--muted);
        width: 3.5em;
        text-align: right;
    }

    .word-table .word a {
        font-weight: 700;
        color: var(--headword);
        text-decoration: none;
        font-size: 1.1em;
    }

        .word-table .word a:hover {
            text-decoration: underline;
        }

    .word-table .pron {
        white-space: nowrap;
    }

    .word-table .en {
        color: var(--muted);
        font-size: 15px;
    }

.not-found {
    max-width: 720px;
}

/* ---- Access code page ------------------------------------------------------------------------- */

.visually-hidden {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
    white-space: nowrap;
}

.access-page {
    min-height: 100vh;
    display: grid;
    place-items: center;
    padding: 24px 16px;
    background: linear-gradient(180deg, var(--brand-soft) 0%, var(--surface) 70%);
}

.access-card {
    width: 100%;
    max-width: 420px;
    text-align: center;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: 24px;
    box-shadow: 0 16px 48px rgb(var(--shadow-rgb) / .10);
    padding: 36px 32px 28px;
}

    .access-card h1 {
        font-size: 1.5rem;
        margin: 22px 0 6px;
    }

.access-logo {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    color: var(--brand);
    font-size: 24px;
    font-weight: 800;
}

    .access-logo svg {
        width: 40px;
        height: 40px;
    }

.access-lead {
    color: var(--ink-soft);
    margin: 0 0 22px;
}

.access-form {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.access-input {
    font: inherit;
    font-family: ui-monospace, "Cascadia Mono", Consolas, monospace;
    font-size: 26px;
    font-weight: 700;
    letter-spacing: .18em;
    text-align: center;
    text-transform: uppercase;
    padding: 14px 12px;
    border: 2px solid var(--line);
    border-radius: 14px;
    outline: none;
    width: 100%;
}

    .access-input::placeholder {
        color: var(--placeholder);
        font-weight: 600;
    }

    .access-input:focus {
        border-color: var(--brand);
        box-shadow: 0 0 0 4px rgb(var(--ring-rgb) / .14);
    }

    .access-input.has-error {
        border-color: var(--danger);
    }

.access-error {
    margin: 0;
    color: var(--danger);
    font-size: 15px;
}

.access-submit {
    width: 100%;
    font-size: 17px;
    padding: 12px 18px;
}

.access-foot {
    margin: 20px 0 0;
    color: var(--muted);
    font-size: 14px;
    line-height: 1.6;
}

    .access-foot a {
        color: var(--brand);
    }

.access-sample {
    font-family: ui-monospace, "Cascadia Mono", Consolas, monospace;
    font-weight: 700;
    color: var(--ink-soft);
}

.site-footer a {
    color: inherit;
}

/* ---- My words: shared controls ---------------------------------------------------------------- */

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    font: inherit;
    font-size: 15px;
    font-weight: 600;
    line-height: 1.2;
    padding: 8px 16px;
    border-radius: 999px;
    border: 1px solid var(--line);
    background: var(--surface);
    color: var(--ink);
    text-decoration: none;
    cursor: pointer;
    white-space: nowrap;
    transition: background .15s, border-color .15s;
}

    .btn:hover:not(:disabled) {
        border-color: var(--brand);
        background: var(--brand-soft);
    }

    .btn:disabled {
        opacity: .5;
        cursor: default;
    }

.btn-primary {
    background: var(--brand);
    border-color: var(--brand);
    color: var(--on-brand);
}

    .btn-primary:hover:not(:disabled) {
        background: var(--brand-dark);
        border-color: var(--brand-dark);
        color: var(--on-brand);
    }

.btn-danger {
    color: var(--danger);
}

    .btn-danger:hover:not(:disabled) {
        border-color: var(--danger);
        background: var(--danger-soft);
    }

.btn-small {
    font-size: 14px;
    padding: 5px 12px;
}

.btn-link {
    border-color: transparent;
    background: none;
}

.file-btn {
    position: relative;
    overflow: hidden;
}

    .file-btn input[type=file] {
        position: absolute;
        inset: 0;
        opacity: 0;
        cursor: pointer;
    }

.segmented {
    display: inline-flex;
    background: var(--bg-soft);
    border: 1px solid var(--line);
    border-radius: 999px;
    padding: 3px;
    gap: 2px;
}

    .segmented button {
        font: inherit;
        font-size: 14px;
        font-weight: 600;
        border: 0;
        background: none;
        color: var(--ink-soft);
        padding: 4px 12px;
        border-radius: 999px;
        cursor: pointer;
    }

        .segmented button.on {
            background: var(--surface);
            color: var(--brand);
            box-shadow: 0 1px 3px rgb(var(--shadow-rgb) / .15);
        }

        .segmented button.on.uk {
            color: var(--uk);
        }

        .segmented button.on.us {
            color: var(--us);
        }

    .segmented .count {
        font-weight: 400;
        color: var(--muted);
        margin-left: 2px;
    }

.inline-form {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
    margin: 0 0 16px;
}

    .inline-form input, .add-word input, .filter-input {
        font: inherit;
        font-size: 15px;
        padding: 8px 14px;
        border: 1px solid var(--line);
        border-radius: 999px;
        min-width: 0;
        outline: none;
    }

        .inline-form input:focus, .add-word input:focus, .filter-input:focus {
            border-color: var(--brand);
            box-shadow: 0 0 0 3px rgb(var(--ring-rgb) / .12);
        }

.notice {
    background: var(--ok-soft);
    color: var(--ok);
    border-radius: 10px;
    padding: 8px 14px;
    margin: 0 0 16px;
}

.notice-error {
    background: var(--danger-soft);
    color: var(--danger);
}

/* ---- My words: lists page ---------------------------------------------------------------------- */

.study-head {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px 24px;
    margin-bottom: 12px;
}

    .study-head .pagetitle {
        margin-bottom: 4px;
    }

.study-intro {
    max-width: 620px;
    margin: 0;
}

    .study-intro a, .template-note a {
        color: var(--brand);
    }

.study-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.list-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 18px;
    margin: 20px 0 40px;
}

.list-card {
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 18px 20px;
    background: var(--surface);
}

.list-card-default {
    border-color: var(--brand-line);
    background: linear-gradient(180deg, var(--brand-soft), var(--surface) 70%);
}

.list-name {
    display: block;
    font-size: 1.15rem;
    font-weight: 800;
    color: var(--ink);
    text-decoration: none;
}

    .list-name:hover {
        color: var(--brand);
    }

.list-badge {
    display: inline-block;
    font-size: 12px;
    font-weight: 600;
    color: var(--brand);
    margin-top: 2px;
}

.list-progress {
    display: block;
    height: 6px;
    border-radius: 999px;
    background: var(--line);
    overflow: hidden;
    margin: 14px 0 6px;
}

    .list-progress > span {
        display: block;
        height: 100%;
        background: var(--pos);
        border-radius: 999px;
    }

    .list-progress.inline {
        display: inline-block;
        width: 120px;
        margin: 0 0 0 10px;
        vertical-align: middle;
    }

.list-stats {
    margin: 0 0 14px;
    font-size: 14px;
    color: var(--muted);
}

.list-card-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.save-as {
    margin: 12px 0 0;
}

.import-help {
    max-width: 640px;
}

.sample-sheet {
    border-collapse: collapse;
    font-size: 14px;
}

    .sample-sheet th, .sample-sheet td {
        border: 1px solid var(--line);
        padding: 4px 12px;
        text-align: left;
    }

    .sample-sheet th {
        background: var(--bg-soft);
    }

.template-note {
    margin: 0 0 16px;
}

/* ---- My words: word book --------------------------------------------------------------------- */

.list-summary {
    margin: 0;
}

.player-bar {
    position: sticky;
    top: 0;
    z-index: 20;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 10px 18px;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: 16px;
    box-shadow: 0 6px 20px rgb(var(--shadow-rgb) / .08);
    padding: 12px 16px;
    margin: 16px 0;
}

.btn-play {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font: inherit;
    font-size: 16px;
    font-weight: 700;
    padding: 10px 22px;
    border: 0;
    border-radius: 999px;
    background: var(--brand);
    color: var(--on-brand);
    cursor: pointer;
}

    .btn-play:hover:not(:disabled) {
        background: var(--brand-dark);
    }

    .btn-play.is-playing {
        background: var(--headword);
    }

    .btn-play:disabled {
        opacity: .5;
        cursor: default;
    }

.now-playing {
    flex: 1 1 180px;
    min-width: 0;
    font-size: 15px;
}

    .now-playing strong {
        font-size: 1.15rem;
        color: var(--headword);
        margin-right: 6px;
    }

.player-options {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px 16px;
    font-size: 14px;
}

.opt {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    cursor: pointer;
    white-space: nowrap;
}

    .opt input[type=checkbox], .check input[type=checkbox] {
        width: 17px;
        height: 17px;
        accent-color: var(--brand);
        cursor: pointer;
    }

    .opt select {
        font: inherit;
        padding: 3px 6px;
        border: 1px solid var(--line);
        border-radius: 8px;
        background: var(--surface);
    }

.list-tools {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 10px;
    margin-bottom: 12px;
}

.filter-input {
    flex: 0 1 200px;
}

.add-word {
    display: flex;
    gap: 6px;
    margin-left: auto;
}

.batch-bar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
    background: var(--brand-soft);
    border-radius: 12px;
    padding: 8px 14px;
    margin-bottom: 12px;
}

    .batch-bar strong {
        margin-right: 6px;
    }

.empty-state {
    text-align: center;
    color: var(--ink-soft);
    background: var(--bg-soft);
    border-radius: var(--radius);
    padding: 36px 20px;
}

.fake-btn {
    display: inline-block;
    border: 1px solid var(--line);
    border-radius: 999px;
    padding: 0 10px;
    background: var(--surface);
    font-weight: 600;
    font-size: .9em;
}

.study-table .check {
    width: 36px;
}

.study-table .mastered-col {
    width: 90px;
    text-align: center;
}

.study-table .meaning {
    color: var(--ink-soft);
    font-size: 15px;
}

.study-table.hide-meaning .meaning-col {
    visibility: hidden;
}

.study-table .example-line {
    display: block;
    color: var(--muted);
    font-size: 14px;
    margin-top: 4px;
}

    .study-table .example-line .speaker {
        color: var(--brand);
        margin-right: 4px;
    }

.study-table tr.is-selected td {
    background: var(--row-selected);
}

.study-table tr.is-mastered .word a {
    color: var(--pos);
}

.study-table tr.is-playing td {
    background: var(--row-playing);
}

    .study-table tr.is-playing td:first-child {
        box-shadow: inset 4px 0 0 var(--headword);
    }

.mastered-toggle {
    width: 34px;
    height: 34px;
    border-radius: 50%;
    border: 2px solid var(--line);
    background: var(--surface);
    color: transparent;
    font-size: 16px;
    font-weight: 800;
    cursor: pointer;
}

    .mastered-toggle:hover {
        border-color: var(--pos);
        color: var(--pos-faint);
    }

    .mastered-toggle.on {
        background: var(--pos);
        border-color: var(--pos);
        color: var(--on-brand);
    }

.pager button {
    font: inherit;
    min-width: 36px;
    padding: 5px 12px;
    border: 0;
    border-radius: 10px;
    background: var(--bg-soft);
    font-size: 15px;
    cursor: pointer;
}

    .pager button:hover {
        background: var(--brand-soft);
        color: var(--brand);
    }

/* ---- My words: groups ------------------------------------------------------------------------- */

.group-bar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 10px 20px;
    margin: 16px 0 0;
    font-size: 15px;
}

.group-nav {
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

    .group-nav .btn-small {
        min-width: 36px;
        font-size: 18px;
        padding: 2px 10px;
    }

.group-current {
    display: inline-flex;
    align-items: baseline;
    gap: 6px;
    font: inherit;
    font-size: 15px;
    padding: 6px 14px;
    border: 1px solid var(--brand-line);
    border-radius: 999px;
    background: var(--brand-soft);
    color: var(--brand);
    cursor: pointer;
}

    .group-current strong {
        font-size: 16px;
    }

    .group-current .muted {
        font-size: 14px;
    }

.group-progress {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: var(--muted);
    font-size: 14px;
}

    .group-progress .list-progress.inline {
        margin: 0;
    }

.group-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(64px, 1fr));
    gap: 8px;
    max-height: 260px;
    overflow: auto;
    padding: 12px;
    margin: 12px 0 0;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: var(--surface);
}

.group-tile {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    font: inherit;
    font-weight: 700;
    font-size: 15px;
    padding: 8px 6px;
    border: 1px solid var(--line);
    border-radius: 10px;
    background: var(--bg-soft);
    color: var(--ink);
    cursor: pointer;
}

    .group-tile:hover {
        border-color: var(--brand);
    }

    .group-tile.current {
        border-color: var(--brand);
        background: var(--brand);
        color: var(--on-brand);
    }

    .group-tile.done:not(.current) {
        color: var(--pos);
        background: var(--ok-soft);
        border-color: var(--ok-line);
    }

.group-mini {
    display: block;
    width: 100%;
    height: 4px;
    border-radius: 999px;
    background: var(--track);
    overflow: hidden;
}

    .group-mini > span {
        display: block;
        height: 100%;
        background: var(--pos);
    }

.group-tile.current .group-mini > span {
    background: var(--surface);
}

.group-done {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 10px;
    margin: 16px 0 0;
    padding: 14px 18px;
    border-radius: var(--radius);
    background: var(--ok-soft);
    border: 1px solid var(--ok-line);
}

.group-done-text {
    margin-right: auto;
    font-size: 16px;
}

.play-from {
    width: 26px;
    height: 26px;
    margin-right: 6px;
    border: 0;
    border-radius: 50%;
    background: var(--brand-soft);
    color: var(--brand);
    font-size: 11px;
    cursor: pointer;
    vertical-align: middle;
}

    .play-from:hover {
        background: var(--brand);
        color: var(--on-brand);
    }

.btn-text {
    font: inherit;
    font-size: 14px;
    font-weight: 600;
    border: 0;
    background: none;
    color: var(--brand);
    cursor: pointer;
    padding: 0 4px;
    margin-left: 6px;
}

    .btn-text:hover {
        text-decoration: underline;
    }

html.kd-fullscreen .group-bar,
html.kd-fullscreen .group-grid {
    display: none;
}

/* ---- My words: slides ------------------------------------------------------------------------- */

.slide {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    max-width: 720px;
    margin: 8px auto 24px;
    padding: 28px 28px 20px;
    border: 1px solid var(--line);
    border-radius: 24px;
    background: linear-gradient(180deg, var(--surface), var(--bg-soft));
    box-shadow: 0 12px 36px rgb(var(--shadow-rgb) / .08);
    outline: none;
}

    .slide:focus-visible {
        border-color: var(--brand);
        box-shadow: 0 0 0 4px rgb(var(--ring-rgb) / .14);
    }

    .slide.is-playing {
        border-color: var(--amber-line);
    }

.slide-top {
    display: flex;
    align-items: center;
    gap: 12px;
    width: 100%;
    font-size: 14px;
}

.slide-bar {
    flex: 1;
    height: 6px;
    border-radius: 999px;
    background: var(--line);
    overflow: hidden;
}

    .slide-bar > span {
        display: block;
        height: 100%;
        background: var(--brand);
        transition: width .3s;
    }

.slide-word {
    margin: 28px 0 4px;
    font-size: clamp(2.4rem, 7vw, 4rem);
    font-weight: 800;
    letter-spacing: -1px;
    line-height: 1.1;
    color: var(--headword);
    text-decoration: none;
    word-break: break-word;
}

    .slide-word:hover {
        text-decoration: underline;
    }

    .slide-word.is-mastered {
        color: var(--pos);
    }

.slide-pron {
    font-family: var(--font-ipa);
    font-size: 1.25rem;
    color: var(--ink-soft);
}

.slide-audio {
    margin: 14px 0 6px;
}

    .slide-audio .speaker {
        font-size: 16px;
        padding: 8px 18px 8px 14px;
    }

.slide-meaning {
    min-height: 110px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    margin: 10px 0 18px;
}

.slide-def {
    font-size: 1.2rem;
    color: var(--ink);
    max-width: 560px;
    margin: 0 0 10px;
}

.slide-example {
    color: var(--muted);
    margin: 0;
    max-width: 560px;
}

    .slide-example .speaker {
        color: var(--brand);
        margin-right: 6px;
    }

.slide-nav {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    width: 100%;
}

.slide-mastered {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font: inherit;
    font-size: 15px;
    font-weight: 600;
    border: 0;
    background: none;
    color: var(--ink-soft);
    cursor: pointer;
}

    .slide-mastered.on {
        color: var(--pos);
    }

    .slide-mastered .mastered-toggle {
        display: inline-grid;
        place-items: center;
    }

.slide-keys {
    font-size: 13px;
    margin: 16px 0 0;
}

.slide-fullscreen {
    flex: none;
    width: 34px;
    height: 34px;
    border: 1px solid var(--line);
    border-radius: 10px;
    background: var(--surface);
    color: var(--ink-soft);
    font-size: 17px;
    line-height: 1;
    cursor: pointer;
}

    .slide-fullscreen:hover {
        border-color: var(--brand);
        color: var(--brand);
    }

/* Full screen (Slides): only the player bar and the card, the card filling the screen. */
html.kd-fullscreen body {
    background: linear-gradient(180deg, var(--brand-soft), var(--surface) 60%);
}

html.kd-fullscreen .site-header,
html.kd-fullscreen .site-footer,
html.kd-fullscreen .skip-link,
html.kd-fullscreen .breadcrumb,
html.kd-fullscreen .study-head,
html.kd-fullscreen .save-as,
html.kd-fullscreen .notice,
html.kd-fullscreen .list-tools,
html.kd-fullscreen .slide-keys {
    display: none;
}

html.kd-fullscreen .site-main {
    max-width: 1100px;
    min-height: 100vh;
    padding: 20px 24px;
    display: flex;
    flex-direction: column;
}

html.kd-fullscreen .player-bar {
    position: static;
    margin: 0 0 20px;
}

html.kd-fullscreen .slide {
    flex: 1;
    width: 100%;
    max-width: none;
    margin: 0;
    justify-content: center;
    padding: 28px 40px;
}

html.kd-fullscreen .slide-top {
    margin-bottom: auto;
}

html.kd-fullscreen .slide-word {
    font-size: clamp(3.5rem, 10vw, 7rem);
}

html.kd-fullscreen .slide-pron {
    font-size: 1.8rem;
}

html.kd-fullscreen .slide-def {
    font-size: 1.6rem;
    max-width: 860px;
}

html.kd-fullscreen .slide-example {
    font-size: 1.25rem;
    max-width: 860px;
}

html.kd-fullscreen .slide-nav {
    margin-top: auto;
}

/* ---- My words: add buttons -------------------------------------------------------------------- */

.title-row {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px 20px;
    margin-bottom: 16px;
}

    .title-row .pagetitle {
        margin: 0;
    }

.add-to-list {
    position: relative;
    display: inline-flex;
    align-items: center;
    flex-wrap: wrap;
}

.btn-add, .btn-add-more {
    font: inherit;
    font-size: 15px;
    font-weight: 700;
    border: 1px solid var(--line);
    background: var(--surface);
    color: var(--brand);
    cursor: pointer;
    padding: 7px 14px;
}

.btn-add {
    border-radius: 999px 0 0 999px;
}

.btn-add-more {
    border-left: 0;
    border-radius: 0 999px 999px 0;
    padding: 7px 12px 7px 10px;
}

    .btn-add:hover:not(:disabled), .btn-add-more:hover:not(:disabled) {
        background: var(--brand-soft);
    }

.btn-add.on {
    background: var(--amber-soft);
    color: var(--amber);
    border-color: var(--amber-line);
}

    .btn-add.on + .btn-add-more {
        border-color: var(--amber-line);
    }

.btn-add:disabled, .btn-add-more:disabled {
    opacity: .6;
    cursor: default;
}

.add-menu {
    position: absolute;
    top: calc(100% + 6px);
    left: 0;
    z-index: 30;
    min-width: 240px;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: 12px;
    box-shadow: 0 12px 32px rgb(var(--shadow-rgb) / .16);
    padding: 6px;
}

.add-menu-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 10px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 15px;
}

    .add-menu-item:hover {
        background: var(--bg-soft);
    }

    .add-menu-item .muted {
        margin-left: auto;
        font-size: 13px;
    }

.add-menu-link {
    display: block;
    padding: 6px 10px;
    font-size: 14px;
    color: var(--brand);
    text-decoration: none;
    border-top: 1px solid var(--line);
    margin-top: 4px;
}

.add-status {
    font-size: 14px;
    color: var(--pos);
    margin-left: 10px;
}

.suggest li {
    display: flex;
    align-items: center;
}

    .suggest li > a {
        flex: 1;
        min-width: 0;
    }

.suggest-add {
    flex: none;
    width: 30px;
    height: 30px;
    margin: 0 4px;
    border: 0;
    border-radius: 50%;
    background: none;
    color: var(--muted);
    font-size: 16px;
    cursor: pointer;
}

    .suggest-add:hover {
        background: var(--brand-soft);
        color: var(--brand);
    }

    .suggest-add.on {
        color: var(--pos);
    }

.site-nav a.nav-mywords {
    color: var(--brand);
}

/* ---- Small screens ---------------------------------------------------------------------------- */

@media (max-width: 960px) {
    .page-columns {
        grid-template-columns: minmax(0, 1fr);
        gap: 16px;
    }

    .side-column {
        position: static;
    }
}

@media (max-width: 640px) {
    body {
        font-size: 16px;
    }

    .header-inner {
        padding: 12px 16px;
        gap: 10px 4px;
    }

    .logo {
        font-size: 21px;
        gap: 8px;
    }

    .logo-mark {
        width: 28px;
        height: 28px;
    }

    .site-nav {
        margin-left: auto;
        gap: 0;
    }

        .site-nav a {
            padding: 6px 7px;
            font-size: 14px;
        }

    .site-header .theme-toggle {
        width: 32px;
        height: 32px;
    }

        .site-header .theme-toggle .theme-icon {
            width: 16px;
            height: 16px;
        }

    /* Second row: the search box, with the theme button beside it (the first row is full). */
    .site-header .searchbox {
        order: 3;
        flex: 1 1 220px;
        max-width: none;
    }

    .site-header .theme-toggle {
        order: 4;
        margin-left: auto;
        align-self: center;
    }

    .site-main {
        padding: 24px 16px 48px;
    }

    .hero {
        margin-bottom: 28px;
        padding: 32px 14px 28px;
        border-radius: 18px;
    }

    .Sense.numbered {
        padding-left: 34px;
    }

    .Box {
        padding: 16px;
    }

    .word-table .num {
        display: none;
    }

    .player-bar {
        position: static;
        padding: 10px 12px;
        border-radius: 14px;
    }

    .slide {
        padding: 18px 14px 16px;
        border-radius: 18px;
    }

    .slide-keys {
        display: none;
    }

    /* Word book rows become compact cards: word and audio on top, meaning underneath. */
    .study-table thead {
        display: none;
    }

    .study-table tbody tr {
        display: grid;
        grid-template-columns: 26px 1fr auto;
        grid-template-areas:
            "check word mastered"
            "check pron mastered"
            "check meaning meaning";
        gap: 4px 8px;
        padding: 12px 4px;
        border-bottom: 1px solid var(--line);
    }

        .study-table tbody tr.is-playing {
            background: var(--row-playing);
        }

    .study-table td {
        display: block;
        border: 0;
        padding: 0;
    }

        .study-table td.check { grid-area: check; }
        .study-table td.word { grid-area: word; }
        .study-table td.pron { grid-area: pron; }
        .study-table td.meaning { grid-area: meaning; }

        .study-table td.mastered-col {
            grid-area: mastered;
            align-self: center;
            width: auto;
        }

    .add-word {
        margin-left: 0;
        flex: 1 1 100%;
    }

        .add-word input {
            flex: 1;
        }

}

/* ---- Dark theme --------------------------------------------------------------------------------
   Follows the system setting until the visitor picks one with the theme button (html[data-theme]). */

@media (prefers-color-scheme: dark) {
    :root:not([data-theme="light"]) {
        --ink: #e5e7ee;
        --ink-soft: #c2c7d3;
        --muted: #949bad;
        --line: #2b3141;
        --bg: #11141c;
        --bg-soft: #171b26;
        --surface: #1a1e2a;
        --brand: #93a4ff;
        --brand-dark: #b4c0ff;
        --brand-soft: #222a47;
        --brand-soft-2: #2d375c;
        --brand-line: #3a4570;
        --on-brand: #0d1122;
        --headword: #ff8a92;
        --uk: #ff8592;
        --uk-soft: #3b2128;
        --us: #7fb0ff;
        --us-soft: #1b2a45;
        --pos: #5bd98c;
        --signpost-bg: #3a2b16;
        --signpost: #f5b56b;
        --register: #d3a6ff;
        --geo: #93b4ff;
        --example: #b7bdca;
        --line-strong: #4a5165;
        --chip: #262b39;
        --track: rgba(255, 255, 255, .12);
        --placeholder: #5a6175;
        --flash: #4a4220;
        --hint-bg: #2c2618;
        --danger: #ff8080;
        --danger-soft: #3b1d20;
        --ok: #7be0a3;
        --ok-soft: #16301f;
        --ok-line: #24553a;
        --pos-faint: #2f6b47;
        --amber: #f3c35f;
        --amber-soft: #352b14;
        --amber-line: #6b5520;
        --etym: #f0cf63;
        --etym-bg: #3a3214;
        --row-selected: #1f2640;
        --row-playing: #3a3418;
        --ring-rgb: 147 164 255;
        --shadow-rgb: 0 0 0;
        color-scheme: dark;
    }
}

:root[data-theme="dark"] {
    --ink: #e5e7ee;
    --ink-soft: #c2c7d3;
    --muted: #949bad;
    --line: #2b3141;
    --bg: #11141c;
    --bg-soft: #171b26;
    --surface: #1a1e2a;
    --brand: #93a4ff;
    --brand-dark: #b4c0ff;
    --brand-soft: #222a47;
    --brand-soft-2: #2d375c;
    --brand-line: #3a4570;
    --on-brand: #0d1122;
    --headword: #ff8a92;
    --uk: #ff8592;
    --uk-soft: #3b2128;
    --us: #7fb0ff;
    --us-soft: #1b2a45;
    --pos: #5bd98c;
    --signpost-bg: #3a2b16;
    --signpost: #f5b56b;
    --register: #d3a6ff;
    --geo: #93b4ff;
    --example: #b7bdca;
    --line-strong: #4a5165;
    --chip: #262b39;
    --track: rgba(255, 255, 255, .12);
    --placeholder: #5a6175;
    --flash: #4a4220;
    --hint-bg: #2c2618;
    --danger: #ff8080;
    --danger-soft: #3b1d20;
    --ok: #7be0a3;
    --ok-soft: #16301f;
    --ok-line: #24553a;
    --pos-faint: #2f6b47;
    --amber: #f3c35f;
    --amber-soft: #352b14;
    --amber-line: #6b5520;
    --etym: #f0cf63;
    --etym-bg: #3a3214;
    --row-selected: #1f2640;
    --row-playing: #3a3418;
    --ring-rgb: 147 164 255;
    --shadow-rgb: 0 0 0;
    color-scheme: dark;
}

/* Dictionary boxes (collocations, thesaurus, grammar, usage) */
:root[data-theme="dark"] .Box { --box-bg: #1c2133; --box-chip: #2a3150; }
:root[data-theme="dark"] .ColloBox { --box-accent: #c4a5ff; --box-bg: #221c33; --box-chip: #352a52; }
:root[data-theme="dark"] .ThesBox { --box-accent: #5fd3a8; --box-bg: #15261f; --box-chip: #1f3d30; }
:root[data-theme="dark"] .GramBox { --box-accent: #8fb3ff; --box-bg: #18223a; --box-chip: #233458; }
:root[data-theme="dark"] .UsageBox, :root[data-theme="dark"] .F2NBox { --box-accent: #f5b56b; --box-bg: #2a2216; --box-chip: #45361d; }

@media (prefers-color-scheme: dark) {
    :root:not([data-theme="light"]) .Box { --box-bg: #1c2133; --box-chip: #2a3150; }
    :root:not([data-theme="light"]) .ColloBox { --box-accent: #c4a5ff; --box-bg: #221c33; --box-chip: #352a52; }
    :root:not([data-theme="light"]) .ThesBox { --box-accent: #5fd3a8; --box-bg: #15261f; --box-chip: #1f3d30; }
    :root:not([data-theme="light"]) .GramBox { --box-accent: #8fb3ff; --box-bg: #18223a; --box-chip: #233458; }
    :root:not([data-theme="light"]) .UsageBox, :root:not([data-theme="light"]) .F2NBox { --box-accent: #f5b56b; --box-bg: #2a2216; --box-chip: #45361d; }
}

/* ---- Blazor ----------------------------------------------------------------------------------- */

.blazor-error-boundary {
    background: #b32121;
    padding: 1rem;
    color: white;
}

    .blazor-error-boundary::after {
        content: "An error has occurred.";
    }
