/* Shared word ordering: the same chips and drop zones in lessons and worksheets. */
[data-word-order] { display:grid; gap:.75rem; min-width:0; }
[data-word-order] > p,
[data-word-order] .word-order__composition > p { min-height:0; margin:0; }
.word-order__composition { position:relative; min-width:0; }
.word-order__composition > .word-order__empty:not([hidden]) {
    position:absolute;
    inset:0;
    display:flex;
    align-items:center;
    padding:.6rem;
    pointer-events:none;
}
.word-order__composition > .word-order__zone.is-drop-target + .word-order__empty { visibility:hidden; }
.word-order__zone {
    display:flex;
    flex-wrap:wrap;
    align-items:center;
    gap:.5rem;
    min-width:0;
    min-height:56px;
    margin:0;
    padding:.6rem;
    border:1px dashed rgba(148,163,184,.7);
    border-radius:14px;
    background:rgba(249,250,251,.9);
    list-style:none;
    touch-action:pan-y;
    transition:border-color .15s ease, background-color .15s ease;
}
.word-order__zone[hidden] { display:none!important; }
.word-order__zone.is-drop-target {
    border-color:#0047a0;
    background:#edf4fc;
    box-shadow:0 0 0 2px rgba(0,71,160,.08);
}
.word-order__chip,
.word-order__ghost {
    display:inline-flex;
    align-items:center;
    justify-content:center;
    flex:0 1 auto;
    max-width:100%;
    min-height:34px;
    margin:0;
    padding:.35rem .7rem;
    border:1px solid rgba(0,71,160,.18);
    border-radius:999px;
    background:rgba(0,71,160,.06);
    color:#111827;
    font:inherit;
    font-weight:800;
    line-height:1.5;
    text-align:center;
    overflow-wrap:anywhere;
    cursor:grab;
    user-select:none;
    -webkit-user-select:none;
    transition:background-color .15s ease, border-color .15s ease, box-shadow .15s ease;
}
.word-order__chip { touch-action:none; }
.word-order__chip:hover:not(:disabled):not([aria-disabled="true"]) {
    border-color:rgba(0,71,160,.4);
    background:rgba(0,71,160,.1);
    transform:none;
}
.word-order__chip:focus-visible {
    outline:3px solid #0047a0;
    outline-offset:3px;
}
.word-order__chip.is-dragging {
    opacity:.35;
    cursor:grabbing;
    transform:none;
}
.word-order__chip:disabled,
.word-order__chip[aria-disabled="true"] {
    background:rgba(0,71,160,.06);
    color:#111827;
    opacity:1;
    cursor:default;
    touch-action:auto;
    transform:none;
}
.word-order__ghost {
    position:fixed;
    z-index:1080;
    max-width:min(20rem,calc(100vw - 2rem));
    background:#eaf1fa;
    box-shadow:0 5px 18px rgba(0,47,106,.18);
    pointer-events:none;
    cursor:grabbing;
    transition:none;
}
.word-order__placeholder {
    align-self:stretch;
    flex:0 0 3px;
    min-height:34px;
    margin:0 .1rem;
    border-radius:999px;
    background:#0047a0;
    pointer-events:none;
}
.word-order__empty {
    margin:0;
    color:#6b7280;
    font-size:.9rem;
    line-height:1.5;
}
.word-order__progress {
    margin:0;
    color:#6b7280;
    font-size:.8rem;
    line-height:1.5;
}
@media (pointer:coarse) {
    .word-order__chip,
    .word-order__ghost { min-height:44px; min-width:44px; }
    .word-order__placeholder { min-height:44px; }
    .word-order__zone { gap:.6rem; }
}
@media (max-width:480px) {
    .word-order__zone { padding:.55rem; border-radius:12px; }
    .word-order__chip,
    .word-order__ghost { padding:.4rem .65rem; }
}
@media (prefers-reduced-motion:reduce) {
    .word-order__zone,
    .word-order__chip { transition:none; }
}
