.elg-sentence {
    max-width: 960px;
    margin: 24px auto;
    padding: 20px;
    border: 1px solid #dbeafe;
    border-radius: 18px;
    background: linear-gradient(145deg, #f8fafc, #eef2ff);
    color: #172033;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif;
    box-shadow: 0 18px 44px rgba(30, 41, 59, .12);
    box-sizing: border-box;
}
.elg-sentence *, .elg-sentence *::before, .elg-sentence *::after { box-sizing: border-box; }
.elg-sentence [hidden] { display: none !important; }
.elg-sen-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 16px;
}
.elg-sen-kicker {
    color: #0ea5e9;
    font-size: .76rem;
    font-weight: 800;
    text-transform: uppercase;
}
.elg-sen-title {
    margin: 2px 0 0;
    color: #312e81;
    font-size: 1.35rem;
    font-weight: 900;
}
.elg-sen-stats {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    justify-content: flex-end;
}
.elg-sen-stats span {
    min-height: 38px;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 14px;
    border: 1px solid #c7d2fe;
    border-radius: 999px;
    background: #fff;
    color: #334155;
    font-weight: 900;
}
.elg-sen-icon-btn {
     
    height: 38px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    border: 1px solid #c7d2fe;
    border-radius: 10px;
    background: #fff;
    color: #4338ca;
    cursor: pointer;
    transition: background .2s ease, transform .1s ease;
}
.elg-sen-icon-btn:hover,
.elg-sen-icon-btn:focus-visible {
    background: #eff6ff;
    outline: none;
}
.elg-sen-icon-btn:active {
    transform: scale(.96);
}
.elg-sen-icon-btn svg,
.elg-sen-icon-btn svg path,
.elg-sen-icon-btn svg line,
.elg-sen-icon-btn svg circle {
    width: 18px;
    height: 18px;
    fill: none;
    stroke: currentColor;
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
}
.elg-sen-setup,
.elg-sen-play {
    padding: 18px;
    border: 1px solid rgba(199, 210, 254, .9);
    border-radius: 16px;
    background: rgba(255,255,255,.92);
    box-shadow: 0 12px 26px rgba(79, 70, 229, .08);
}
.elg-sen-label {
    display: block;
    margin-bottom: 8px;
    color: #312e81;
    font-weight: 900;
}
.elg-sen-input {
    width: 100%;
    min-height: 170px;
    padding: 12px 14px;
    border: 1px solid #cbd5e1;
    border-radius: 12px;
    background: #fff;
    color: #172033;
    font: inherit;
    font-weight: 700;
    line-height: 1.55;
    resize: vertical;
    outline: none;
}
.elg-sen-input:focus {
    border-color: #6366f1;
    box-shadow: 0 0 0 3px rgba(99,102,241,.17);
}
.elg-sen-help {
    margin-top: 8px;
    color: #64748b;
    font-size: .9rem;
    font-weight: 700;
}
.elg-sen-check {
    min-height: 48px;
    display: inline-flex;
    align-items: center;
    gap: 10px;
    margin-top: 14px;
    padding: 12px 14px;
    border: 1px solid #bfdbfe;
    border-radius: 14px;
    background: #eff6ff;
    color: #1e3a8a;
    font-weight: 900;
}
.elg-sen-check input {
    width: 20px;
    height: 20px;
    accent-color: #2563eb;
}
.elg-sen-actions {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 10px;
    margin-top: 14px;
}
.elg-sen-btn {
    min-height: 44px;
    padding: 11px 18px;
    border: 0;
    border-radius: 12px;
    background: #e2e8f0;
    color: #334155;
    font: inherit;
    font-size: .95rem;
    font-weight: 900;
    cursor: pointer;
    transition: transform .1s ease, filter .2s ease, background .2s ease;
}
.elg-sen-btn-primary {
    background: #4f46e5;
    color: #fff;
}
.elg-sen-btn:hover:not(:disabled) { filter: brightness(.98); }
.elg-sen-btn:active:not(:disabled) { transform: scale(.96); }
.elg-sen-message {
    min-height: 28px;
    margin-top: 12px;
    color: #475569;
    font-weight: 800;
    text-align: center;
}
.elg-sentence .js-setup-message { color: #dc2626; }
.elg-sen-message.success { color: #15803d; }
.elg-sen-message.error { color: #dc2626; }
.elg-sen-ghost {
    min-height: 42px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 14px;
    padding: 10px 14px;
    border-radius: 14px;
    background: #f8fafc;
    color: rgba(49, 46, 129, .36);
    font-size: clamp(1rem, 2.6vw, 1.35rem);
    font-weight: 900;
    text-align: center;
}
.elg-sen-zone-wrap {
    display: grid;
    grid-template-columns: 1fr;
    gap: 14px;
}
.elg-sen-zone-title {
    margin-bottom: 8px;
    color: #312e81;
    font-weight: 900;
}
.elg-sen-zone {
    min-height: 88px;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 10px;
    padding: 14px;
    border: 2px dashed #bfdbfe;
    border-radius: 16px;
    background: #eff6ff;
}
.elg-sen-answer {
    min-height: 112px;
    border-color: #a5b4fc;
    background: #eef2ff;
}
.elg-sen-chip {
    min-height: 46px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 10px 14px;
    border: 1px solid #c7d2fe;
    border-radius: 999px;
    background: #fff;
    color: #172033;
    font: inherit;
    font-size: .98rem;
    font-weight: 900;
    box-shadow: 0 7px 16px rgba(30, 41, 59, .08);
    cursor: grab;
    touch-action: none;
    user-select: none;
    transition: transform .12s ease, border-color .2s ease, background .2s ease;
}
.elg-sen-chip:active { cursor: grabbing; }
.elg-sen-chip.correct-place {
    border-color: #22c55e;
    background: #dcfce7;
    color: #166534;
}
.elg-sen-chip.is-dragging {
    opacity: .35;
}
.elg-sen-drag-ghost {
    position: fixed;
    z-index: 999999;
    pointer-events: none;
    transform: translate(-50%, -50%);
    opacity: .95;
}
.elg-sen-play.is-correct {
    animation: elg-sen-success .5s ease;
}
@media (max-width: 640px) {
    .elg-sentence { padding: 14px; }
    .elg-sen-header { align-items: flex-start; flex-direction: column; }
    .elg-sen-stats { justify-content: flex-start; }
    .elg-sen-chip { width: auto; max-width: 100%; min-height: 48px; }
    .elg-sen-actions .elg-sen-btn { flex: 1 1 150px; }
}
.elg-sentence:fullscreen,
.elg-sentence.is-fullscreen {
    width: 100vw;
    max-width: none;
    min-height: 100vh;
    margin: 0;
    padding: 20px;
    border: 0;
    border-radius: 0;
    overflow: auto;
}
.elg-sentence:fullscreen .elg-sen-play,
.elg-sentence.is-fullscreen .elg-sen-play {
    min-height: calc(100vh - 130px);
}
@keyframes elg-sen-success {
    0% { transform: scale(1); }
    40% { transform: scale(1.01); }
    100% { transform: scale(1); }
}
