/* Selection actions and note buttons */

.sc-note {
    flex: none;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    margin-left: auto;
    padding: 3px 8px;
    border: 1px solid var(--line-strong);
    border-radius: var(--r-full);
    background: transparent;
    color: var(--muted);
    font-family: var(--font-ui);
    font-size: 11px;
    cursor: pointer;
}

.sc-note:hover {
    background: var(--surface-2);
    color: var(--ink);
}

.sc-note svg {
    width: 12px;
    height: 12px;
}

.sc-ask {
    margin-left: 0;
}

.sentence-ask-actions {
    position: fixed;
    z-index: 118;
    transform: translateX(-50%);
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 4px;
    border: 1px solid var(--line);
    border-radius: var(--r-full);
    background: var(--surface);
    box-shadow: var(--shadow-md);
    opacity: 0;
    pointer-events: none;
    transition: opacity var(--dur-2);
}

.sentence-ask-actions.is-visible {
    opacity: 1;
    pointer-events: auto;
    animation: ask-pop 160ms var(--ease-out);
}

.sentence-ask-action {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 8px 12px;
    border: 0;
    border-radius: var(--r-full);
    background: transparent;
    color: var(--ink-2);
    font-family: var(--font-ui);
    font-size: 12px;
    white-space: nowrap;
    cursor: pointer;
}

.sentence-ask-action:hover {
    background: var(--surface-2);
}

.sentence-ask-action.is-primary {
    background: var(--brand);
    color: var(--surface);
}

.sentence-ask-action.is-primary:hover {
    background: var(--brand-strong);
}

.sentence-ask-action svg {
    width: 14px;
    height: 14px;
}

.sentence-ask-actions.is-fixed-bottom {
    left: 50%;
    top: auto;
    bottom: calc(16px + env(safe-area-inset-bottom));
    width: calc(100% - 28px);
    max-width: 420px;
    justify-content: stretch;
    padding: 5px;
}

.sentence-ask-actions.is-fixed-bottom .sentence-ask-action {
    flex: 1;
    justify-content: center;
    padding: 11px 12px;
}

@media (max-width: 640px) {
    .sc-note {
        margin-left: 0;
    }

    .sc-note span,
    .sc-ask span {
        display: none;
    }

    .sentence-ask-action {
        gap: 4px;
        padding: 8px 8px;
        font-size: 11.5px;
    }

    .sentence-ask-action svg {
        width: 13px;
        height: 13px;
    }

    .sentence-ask-action span {
        display: inline;
    }

    .sentence-ask-actions.is-fixed-bottom .sentence-ask-action {
        padding: 10px 6px;
    }
}

@media print {
    .sentence-ask-actions {
        display: none !important;
    }
}

/* Notes window outline actions */

.accum-note-actions {
    display: flex;
    justify-content: flex-end;
    margin-top: 8px;
}

.accum-note-outline {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 4px 9px;
    border: 1px solid var(--line);
    border-radius: var(--r-full);
    background: transparent;
    color: var(--brand-strong);
    font-family: var(--font-ui);
    font-size: 11px;
    cursor: pointer;
}

[data-theme="dark"] .accum-note-outline {
    color: var(--brand);
}

.accum-note-outline:hover {
    border-color: var(--brand-line);
    background: var(--brand-soft);
}

.accum-note-outline:disabled {
    opacity: 0.6;
    cursor: default;
}

.accum-note-outline svg {
    width: 12px;
    height: 12px;
}

.accum-note-ready {
    color: var(--success);
}

.accum-note-card {
    cursor: pointer;
}

/* Library subject switch */
.lib-subject-switch {
    flex: none;
}

.library-toolbar .lib-subject-switch {
    height: 38px;
    align-items: center;
}

@media (max-width: 720px) {
    .library-toolbar .lib-subject-switch {
        width: 100%;
    }

    .library-toolbar .lib-subject-switch button {
        flex: 1;
    }
}

/* Keep dialogs above study and notes windows, below toasts */
.modal-root {
    z-index: 126;
}
