/* Extracted from app/pages/tools.php */
#st-container {
    position: fixed;
    bottom: 100px;
    right: 20px;
    z-index: 10000;
    font-family: system-ui, -apple-system, sans-serif;
}


#st-main-btn {
    width: 58px;
    height: 58px;
    border-radius: 50%;
    background: linear-gradient(135deg, #1a365d, #2c5282);
    color: #fff;
    border: none;
    cursor: pointer;
    font-size: 22px;
    box-shadow: 0 4px 16px rgba(26,54,93,.35);
    transition: transform .2s, box-shadow .2s;
    display: flex;
    align-items: center;
    justify-content: center;
    -webkit-tap-highlight-color: transparent;
}
#st-main-btn:hover  { transform: scale(1.08); box-shadow: 0 6px 22px rgba(26,54,93,.45); }
#st-main-btn:active { transform: scale(.95); }


#st-panel {
    position: absolute;
    bottom: 68px;
    right: 0;
    background: #fff;
    border-radius: 14px;
    padding: 16px;
    width: 260px;
    max-height: 72vh;
    overflow-y: auto;
    box-shadow: 0 6px 32px rgba(0,0,0,.16);
    border: 1px solid #e2e8f0;
    display: none;
    scrollbar-width: thin;
    scrollbar-color: #cbd5e0 transparent;
}
#st-panel.open {
    display: block;
    animation: st-up .22s ease;
}
#st-panel::-webkit-scrollbar       { width: 5px; }
#st-panel::-webkit-scrollbar-thumb { background: #cbd5e0; border-radius: 3px; }

@keyframes st-up {
    from { opacity:0; transform:translateY(10px); }
    to   { opacity:1; transform:translateY(0); }
}


.st-panel-hd {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 14px;
    padding-bottom: 12px;
    border-bottom: 2px solid #e2e8f0;
}
.st-panel-title { font-weight: 700; color: #1a365d; font-size: 15px; }
#st-close {
    background: none; border: none; font-size: 20px;
    cursor: pointer; color: #718096; line-height: 1;
    width: 30px; height: 30px; border-radius: 6px;
    display: flex; align-items: center; justify-content: center;
}
#st-close:hover { background: #e2e8f0; color: #1a365d; }


.st-tool-btn {
    display: flex;
    align-items: center;
    width: 100%;
    padding: 11px 12px;
    margin: 4px 0;
    background: #f7fafc;
    border: 1.5px solid #e2e8f0;
    border-radius: 9px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    color: #2d3748;
    transition: all .18s;
    text-align: left;
    -webkit-tap-highlight-color: transparent;
}
.st-tool-btn:hover  { background: #edf2f7; transform: translateX(-2px); }
.st-tool-btn.active { background: #1a365d; color: #fff; border-color: #1a365d; }
.st-tool-icon { margin-right: 10px; font-size: 17px; width: 22px; text-align: center; }


.st-status {
    padding: 9px 12px;
    border-radius: 8px;
    font-size: 12.5px;
    line-height: 1.5;
    margin-bottom: 10px;
}
.st-status.dict  { background: #ebf8ff; border: 1px solid #90cdf4; color: #2c5282; }
.st-status.hl    { background: #fffff0; border: 1px solid #f6e05e; color: #744210; }


#st-options { display: none; margin-top: 12px; }
#st-options.open { display: block; animation: st-fade .2s; }
@keyframes st-fade { from{opacity:0} to{opacity:1} }

.st-opt-label { font-size: 12px; color: #718096; margin-bottom: 7px; font-weight: 600; text-transform: uppercase; letter-spacing: .5px; }

.st-colors { display: flex; gap: 7px; flex-wrap: wrap; margin-bottom: 14px; }
.st-color {
    width: 28px; height: 28px; border-radius: 50%;
    border: 2.5px solid transparent; cursor: pointer;
    transition: transform .15s; flex-shrink: 0;
}
.st-color:hover  { transform: scale(1.15); }
.st-color.active { border-color: #1a365d; transform: scale(1.15); box-shadow: 0 2px 6px rgba(0,0,0,.2); }

.st-size-wrap { margin-bottom: 14px; }
.st-size-row  { display: flex; align-items: center; gap: 10px; }
input.st-slider {
    flex: 1; height: 6px; background: #e2e8f0; border-radius: 3px;
    outline: none; -webkit-appearance: none; cursor: pointer;
}
input.st-slider::-webkit-slider-thumb {
    -webkit-appearance: none; width: 18px; height: 18px;
    border-radius: 50%; background: #1a365d; cursor: pointer;
    border: 2px solid #fff; box-shadow: 0 1px 4px rgba(0,0,0,.2);
}
.st-size-val { font-size: 12px; color: #4a5568; min-width: 30px; text-align: right; }

.st-clear-btn {
    width: 100%; padding: 10px; margin-top: 4px;
    background: #fff5f5; color: #9b2c2c;
    border: 1.5px solid #fc8181; border-radius: 8px;
    cursor: pointer; font-size: 13px; font-weight: 600;
    display: flex; align-items: center; justify-content: center; gap: 7px;
    transition: all .18s;
}
.st-clear-btn:hover { background: #fed7d7; transform: translateY(-1px); }

.st-tip {
    margin-top: 12px; padding-top: 10px;
    border-top: 1px solid #e2e8f0;
    font-size: 11.5px; color: #a0aec0; line-height: 1.7;
}


.st-hl {
    position: fixed;
    pointer-events: auto;
    border-radius: 3px;
    mix-blend-mode: multiply;
    opacity: .32;
    transition: opacity .15s;
    z-index: 9990;
}
.st-hl:hover { opacity: .55; cursor: pointer; }

/* active drag highlight */
.st-hl-active {
    position: fixed;
    pointer-events: none;
    border-radius: 3px;
    mix-blend-mode: multiply;
    opacity: .45;
    z-index: 9991;
}


.st-dict-popup {
    position: fixed;
    background: #fff;
    border-radius: 14px;
    padding: 20px;
    width: 340px;
    max-width: 90vw;
    max-height: 70vh;
    overflow-y: auto;
    box-shadow: 0 10px 40px rgba(0,0,0,.2);
    border: 1px solid #e2e8f0;
    z-index: 10010;
    animation: st-fade .22s;
    scrollbar-width: thin;
}
.st-dict-popup::-webkit-scrollbar       { width: 5px; }
.st-dict-popup::-webkit-scrollbar-thumb { background: #cbd5e0; border-radius: 3px; }

.st-dict-word  { font-size: 22px; font-weight: 700; color: #1a365d; }
.st-dict-phon  { font-size: 14px; color: #718096; font-style: italic; margin: 4px 0 14px; }
.st-dict-pos   {
    display: inline-block; font-size: 12px; color: #fff;
    background: #4a5568; padding: 3px 10px; border-radius: 20px;
    margin-bottom: 9px;
}
.st-dict-def   { font-size: 14.5px; color: #2d3748; margin-bottom: 6px; line-height: 1.5; }
.st-dict-ex    {
    font-size: 13.5px; color: #718096; font-style: italic;
    padding-left: 10px; border-left: 3px solid #cbd5e0;
    margin: 5px 0 12px; line-height: 1.5;
}
.st-dict-sep   { border: none; border-top: 1px solid #e2e8f0; margin: 14px 0; }
.st-dict-btns  { display: flex; gap: 10px; margin-top: 16px; padding-top: 14px; border-top: 2px solid #e2e8f0; }
.st-dict-btns button {
    flex: 1; padding: 11px; border: none; border-radius: 8px;
    cursor: pointer; font-size: 14px; font-weight: 600;
    transition: opacity .18s;
}
.st-dict-btns button:hover { opacity: .85; }
.st-dict-speak { background: #1a365d; color: #fff; }
.st-dict-close { background: #e2e8f0; color: #4a5568; }

.st-dict-loader {
    text-align: center; padding: 30px 0; color: #718096; font-size: 14px;
}
.st-spinner {
    width: 28px; height: 28px; border: 3px solid #e2e8f0;
    border-top-color: #1a365d; border-radius: 50%;
    animation: st-spin .7s linear infinite;
    margin: 0 auto 12px;
}
@keyframes st-spin { to { transform: rotate(360deg); } }


#st-toast {
    position: fixed;
    bottom: 90px;
    left: 50%;
    transform: translateX(-50%) translateY(10px);
    background: #2b6cb0;
    color: #fff;
    padding: 10px 18px;
    border-radius: 30px;
    font-size: 13px;
    font-weight: 500;
    z-index: 10020;
    opacity: 0;
    pointer-events: none;
    transition: opacity .25s, transform .25s;
    white-space: nowrap;
    max-width: 88vw;
    text-align: center;
    box-shadow: 0 4px 16px rgba(0,0,0,.2);
}
#st-toast.show {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}


@media (max-width: 768px) {
    #st-container { bottom: 100px; right: 14px; }
    #st-panel { width: 270px; right: -5px; }
    .st-dict-popup {
        left: 50% !important;
        top: 50% !important;
        transform: translate(-50%, -50%) !important;
    }
    #st-toast { bottom: 110px; }
}

@media print {
    #st-container, #st-toast, .st-dict-popup { display: none !important; }
    .st-hl { background: rgba(255,215,0,.4) !important; }
}
