.translation-setting {
    display: flex;
    align-items: center;
    gap: 24px;
    padding: 20px;
    border: 1px solid #dce3ed;
    border-radius: 16px;
    background: #f8faff;
    color: #172033;
}
.translation-setting > div { flex: 1; min-width: 0; }
.translation-setting strong { font-size: 15px; }
.translation-setting p { margin: 6px 0 0; color: #586477; font-size: 13px; line-height: 1.6; }
.translation-setting .translation-setting-switch {
    flex: 0 0 48px;
    width: 48px;
    height: 28px;
    padding: 3px;
    border: 0;
    border-radius: 99px;
    background: #8994a5;
    cursor: pointer;
}
.translation-setting-switch span { display: block; width: 22px; height: 22px; border-radius: 50%; background: #fff; transition: transform .15s ease; }
.translation-setting .translation-setting-switch[aria-checked="true"] { background: #1967d2; }
.translation-setting-switch[aria-checked="true"] span { transform: translateX(20px); }
.translation-setting-switch:focus-visible,
.teacher-translation :is(button, select, a):focus-visible { outline: 3px solid #8ab4f8; outline-offset: 4px; }
.teacher-translation {
    position: fixed;
    z-index: 900;
    right: max(18px, env(safe-area-inset-right));
    bottom: max(18px, env(safe-area-inset-bottom));
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 12px;
    max-width: calc(100vw - 36px);
    color: #202124;
    font: 14px/1.5 Arial, sans-serif;
    text-align: left;
    letter-spacing: normal;
    color-scheme: light;
}
.teacher-translation, .teacher-translation * { box-sizing: border-box; }
.teacher-translation [hidden] { display: none !important; }
.teacher-translation button { font: inherit; cursor: pointer; }
.teacher-translation-trigger {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 52px;
    height: 52px;
    padding: 10px;
    border: 1px solid #dadce0;
    border-radius: 50%;
    background: #fff;
    color: #3c4043;
    box-shadow: 0 3px 16px #0003;
}
.teacher-translation-trigger:hover { background: #f1f6fe; }
.teacher-translation-trigger svg { display: block; flex: 0 0 28px; width: 28px; height: 28px; }
.teacher-translation-panel {
    width: 300px;
    max-width: 100%;
    max-height: calc(100dvh - 108px - env(safe-area-inset-bottom));
    overflow-y: auto;
    padding: 20px;
    background: #fff;
    border: 1px solid #dadce0;
    border-radius: 18px;
    box-shadow: 0 8px 32px #0003;
    overflow-wrap: anywhere;
}
.teacher-translation-heading { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 12px; }
.teacher-translation-heading strong { font-size: 17px; }
.teacher-translation-close { width: 32px; height: 32px; padding: 0; border: 0; border-radius: 50%; background: #f1f3f4; color: #3c4043; font-size: 23px !important; }
.teacher-translation-panel p { margin: 10px 0; color: #5f6368; font: inherit; font-size: 12px; }
.teacher-translation-panel label { display: block; margin: 15px 0 6px; color: #3c4043; font-size: 13px; }
.teacher-translation-panel select { display: block; width: 100%; min-width: 0; height: 44px; padding: 8px; border: 1px solid #dadce0; border-radius: 8px; color: #202124; background: #fff; font: inherit; }
.teacher-translation-action { display: block; width: 100%; min-height: 44px; margin-top: 10px; padding: 10px 12px; border: 0; border-radius: 8px; color: #fff; background: #1967d2; text-align: center; text-decoration: none; }
.teacher-translation-action:hover { background: #185abc; color: #fff; }
.teacher-translation-secondary { color: #1967d2; background: #e8f0fe; }
.teacher-translation-secondary:hover { background: #d2e3fc; color: #174ea6; }
.teacher-translation-status:empty { display: none; }
body.modal-open .teacher-translation { visibility: hidden; }
/* Translated excerpts can be longer; keep the inline Read more control visible. */
html:is(.translated-ltr, .translated-rtl) [data-profile-description] { max-height: none !important; overflow: visible !important; }
html:is(.translated-ltr, .translated-rtl) [data-profile-description-text] { height: auto !important; flex: initial !important; }
@media (max-width: 600px) {
    .teacher-translation { right: max(12px, env(safe-area-inset-right)); bottom: max(12px, env(safe-area-inset-bottom)); max-width: calc(100vw - 24px); }
    .translation-setting { gap: 12px; padding: 16px; }
}
@media (prefers-reduced-motion: reduce) { .translation-setting-switch span { transition: none; } }
